Download a stable release from https://go.dev/dl/ or use your package manager.
PATH for go.go version
brew install go
go version
sudo apt update
sudo apt install golang-go # distro version may lag
Or install a tarball from go.dev/dl into /usr/local/go and add /usr/local/go/bin to PATH.
Initialize a module in your project root:
go mod init example.com/myapp
Dependencies are recorded in go.mod; checksums in go.sum. Commit both.
go get golang.org/x/sync@latest
go mod tidy
go mod vendor
Build with -mod=vendor to use the vendor/ tree (common in CI reproducibility).
Set GOPRIVATE for domains that should not hit the public checksum database:
go env -w GOPRIVATE=*.corp.example
go work init ./app ./lib
Default GOPROXY uses proxy.golang.org. Air-gapped environments run their own module proxy or direct GOPROXY=direct.