Linux install and setup
suggest changeA distribution package manager can install Go, although its packaged version may lag behind the current release:
sudo apt update
sudo apt install golang-go
For the current official release, follow the archive installation instructions at go.dev/doc/install. The archive filename and version change with each release, so use the command shown on that page rather than a pinned filename.
Verify the installation:
go version
go env GOPATH GOBIN
Source code may live anywhere. If GOBIN is unset, go install writes commands to $(go env GOPATH)/bin; add that directory to PATH if needed:
export PATH="$PATH:$(go env GOPATH)/bin"
Place the export in your shell startup file, such as ~/.bashrc or ~/.zshrc.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents