多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
<p align="right">2021年08月31日 13:54:49</p> [TOC] ### go命令 ``` ❯ help go go Tool for managing go source code. More information: https://golang.org. - Download and install a package, specified by its import path: go get package_path - Compile and run a source file (it has to contain a main package): go run file.go - Compile a source file into a named executable: go build -o executable file.go - Compile the package present in the current directory: go build - Execute all test cases of the current package (files have to end with _test.go): go test - Compile and install the current package: go install - Initialize a new module in the current directory: go mod init module_name ``` ### 说明 ``` go env用于打印Go语言的环境信息。 go run命令可以编译并运行命令源码文件。 go get可以根据要求和实际情况从互联网上下载或更新指定的代码包及其依赖包,并对它们进行编译和安装。 go build命令用于编译我们指定的源码文件或代码包以及它们的依赖包。 go install用于编译并安装指定的代码包及它们的依赖包。 go clean命令会删除掉执行其它命令时产生的一些文件和目录。 go doc命令可以打印附于Go语言程序实体上的文档。我们可以通过把程序实体的标识符作为该命令的参数来达到查看其文档的目的。 go test命令用于对Go语言编写的程序进行测试。 go list命令的作用是列出指定的代码包的信息。 go fix会把指定代码包的所有Go语言源码文件中的旧版本代码修正为新版本的代码。 go vet是一个用于检查Go语言源码中静态错误的简单工具。 go tool pprof命令来交互式的访问概要文件的内容。 ```