Subcommands30 subcommands
go build
Compile packages and dependencies
go 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
go fmt
Gofmt (reformat) package sources
go generate
Generate Go files by processing source
go get
Add dependencies to current module and install them
go install
Compile and install packages and dependencies
go list
List packages or modules
go mod download
Download the named modules into the module cache
go mod edit
Edit and format go.mod files
go mod graph
Print the module requirement graph
go mod init
Initialize and write a new go.mod file in the current directory
go mod tidy
Ensure that the go.mod file matches the source code in the module
go mod vendor
Construct a directory named vendor in the main module's root directory
go mod verify
Check that dependencies of the main module stored in the module cache have not been modified since they were downloaded
go mod why
Show a shortest path in the import graph from the main module to each of the listed packages
go work
Workspace maintenance
go work edit
Edit go.work from tools or scripts
go work init
Initialize workspace file
go work sync
Sync workspace build list to modules
go work use
Add modules to workspace file
go run
Compile and run Go program
go tool
Run specified go tool
go version
Print Go version
go vet
Report likely mistakes in packages