go build

Compile Go sources. More information: https://golang.org/cmd/go/#hdr-Compile_packages_and_dependencies.

go build path/to/main.go

go build -o path/to/binary path/to/source.go

go build -o path/to/binary path/to/package

go build -race -o path/to/executable path/to/main/package