美文网首页
go的基本操作

go的基本操作

作者: 小马哥是没有感情的 | 来源:发表于2021-10-08 03:05 被阅读0次
    1. 创建目录
    mkdir hello
    cd hello
    
    1. 创建项目
     go mod init example/hello
    go: creating new go.mod: module example/hello
    
    1. 编写code
    package main
    
    import "fmt"
    
    func main() {
        fmt.Println("Hello, World!")
    }
    
    1. 运行项目
    go run .
    
    
    1. 下载外部包
    go mod tidy
    

    相关文章

      网友评论

          本文标题:go的基本操作

          本文链接:https://www.haomeiwen.com/subject/hjmtoltx.html