Manage multiple Go versions locally using official golang.org/dl launchers and a single symlink switch.
No system-wide Go install, no version managers, no environment juggling.
- Each Go version is installed as a small launcher binary via golang.org/dl
- The launcher downloads and isolates the actual toolchain in
~/sdk/go<version>/ - A single symlink (
~/go/bin/go) determines the active Go version - Switching versions does not require changing environment variables
Examples:
- https://go.dev/dl/
- https://go.dev/dl/?mode=json (machine-readable)
Let's say the target version is 1.26.4.
go install golang.org/dl/go1.26.4@latestThis creates:
~/go/bin/go1.26.4At this point only the launcher exists, not the SDK itself.
go1.26.4 downloadThis downloads the actual toolchain into:
~/sdk/go1.26.4ln -sf ~/go/bin/go1.26.4 ~/go/bin/goAdd this to your shell configuration file (~/.zshrc, ~/.bashrc, etc.):
export PATH="$HOME/go/bin:$PATH"go version
go env GOPATH GOROOTExample output:
go version go1.26.4 darwin/arm64
~/go
~/sdk/go1.26.4
To purge an old version (e.g., 1.25.0), delete its launcher and its SDK directory:
rm -rf ~/go/bin/go1.25.0 ~/sdk/go1.25.0