go
Manage Go source code. Some subcommands such as `build` have their own usage documentation.
More info →Subcommands (17)
Report a bug.
Compile Go sources.
Remove object files and cached files.
View documentation for a package or symbol.
Manage environment variables used by the Go toolchain.
Update packages to use new APIs.
Format Go source files, printing the changed filenames.
Generate Go files by running commands within source files.
Add a dependency package, or download packages in legacy GOPATH mode.
Compile and install packages named by the import paths.
List packages or modules.
Module maintenance.
Compile and run Go code without saving a binary.
Test Go packages (files have to end with `_test.go`).
Run a Go tool or command. Execute a Go command as a stand-alone binary, typically for debugging.
Display Go version.
Check Go source code and report suspicious constructs (e.g. lint your Go source files). Go vet returns a non-zero exit code if problems are found; returns a zero exit code if no problems are found.
Examples (7)
Download and install a package, specified by its import path
go get path/to/packageCompile and run a source file (it has to contain a `main` package)
go run file.goCompile a source file into a named executable
go build -o executable file.goCompile the package present in the current directory
Execute all test cases of the current package (files have to end with `_test.go`)
Compile and install the current package