命令
约 401 字大约 1 分钟
2025-07-02
参数
Go is a tool for managing Go source code.
Usage:
go <command> [arguments]
The commands are:
bug start a bug report
# 编译指定的源码
build compile packages and dependencies
# 会删除掉执行其它命令时产生的一些文件和目录
clean remove object files and cached files
# Go语言文档
doc show documentation for package or symbol
# 用于打印Go语言的环境信息
env print Go environment information
# 把指定代码包的所有Go语言源码文件中的旧版本代码修正为新版本的代码
fix update packages to use new APIs
fmt gofmt (reformat) package sources
generate generate Go files by processing source
# 下载或更新指定的代码包及其依赖包,并对它们进行编译和安装
get add dependencies to current module and install them
# 编译并安装指定的代码包及它们的依赖包
install compile and install packages and dependencies
# 列出指定的代码包的信息
list list packages or modules
mod module maintenance
# 编译并运行命令源码文件
run compile and run Go program
# 测试
test test packages
tool run specified go tool
version print Go version
# 检查Go语言源码中静态错误的简单工具
vet report likely mistakes in packages
Use "go help <command>" for more information about a command.
Additional help topics:
buildconstraint build constraints
buildmode build modes
c calling between Go and C
cache build and test caching
environment environment variables
filetype file types
go.mod the go.mod file
gopath GOPATH environment variable
gopath-get legacy GOPATH go get
goproxy module proxy protocol
importpath import path syntax
modules modules, module versions, and more
module-get module-aware go get
module-auth module authentication using go.sum
packages package lists and patterns
private configuration for downloading non-public code
testflag testing flags
testfunc testing functions
vcs controlling version control with GOVCS
Use "go help <topic>" for more information about that topic.