go - Man Page
build, test, install Go programs
Examples (TL;DR)
- 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
Synopsis
go command [arguments]
Description
A tool for managing Go source code. For full documentation run go help or see http://golang.org/cmd/go.
See Also
Referenced By
January 2015 Go