GO(1)

NAME
go - The Go programming language tool

SYNOPSIS
go command [arguments]

DESCRIPTION
The go command manages Go source code and runs the Go toolchain. It provides compilation, testing, dependency management, and code generation for the Go programming language.

Common subcommands include:

go build
    Compile packages and dependencies.

go run
    Compile and run Go programs.

go test
    Test packages.

go mod
    Module maintenance (add, init, tidy, vendor).

go fmt
    Reformat package sources (invokes gofmt).

go vet
    Report likely mistakes in packages.

go doc
    Show documentation for package or symbol.

go env
    Print Go environment information.

go version
    Print Go compiler version.

go tool
    Run specified Go tool.

Run go help subcommand for detailed usage of a specific subcommand. Run go with no arguments for the full command list.

ENVIRONMENT

GOROOT
    Root of the Go installation tree (set to /usr/lib/go).

GOPATH
    Workspace root for Go source code, packages, and binaries. Defaults to $HOME/go.

GOBIN
    Directory where go install places compiled binaries.

GOARCH
    Target architecture (default amd64).

GOOS
    Target operating system (default linux).

GOMODCACHE
    Directory for downloaded module cache (Go 1.23+; defaults to $GOPATH/pkg/mod).

FILES

/usr/lib/go/
    Go toolchain installation root.

/usr/bin/go
    Symlink to the Go compiler.

$HOME/go/
    Default GOPATH workspace directory.

SEE ALSO
gofmt(1)

More documentation at https://go.dev/doc/.

BUGS
Report bugs at https://go.dev/issue/.

AUTHOR
Go was designed at Google by Robert Griesemer, Rob Pike, and Ken Thompson. This man page was authored for the InterGenOS package.