Skip to content

Instantly share code, notes, and snippets.

@nilox94
Created June 9, 2026 19:15
Show Gist options
  • Select an option

  • Save nilox94/3f4ebad613744d9a30ec26e3f08b908e to your computer and use it in GitHub Desktop.

Select an option

Save nilox94/3f4ebad613744d9a30ec26e3f08b908e to your computer and use it in GitHub Desktop.
Simple Go version management using official launchers and symlinks

Golang Toolchain Management (Local, Versioned)

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.

How it works?

  • 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

Installation

1. Find the desired version

Examples:

Let's say the target version is 1.26.4.

2. Install the launcher

go install golang.org/dl/go1.26.4@latest

This creates:

~/go/bin/go1.26.4

At this point only the launcher exists, not the SDK itself.

3. Download the SDK

go1.26.4 download

This downloads the actual toolchain into:

~/sdk/go1.26.4

4. Select the active version

ln -sf ~/go/bin/go1.26.4 ~/go/bin/go

5. Ensure Go binaries are on PATH

Add this to your shell configuration file (~/.zshrc, ~/.bashrc, etc.):

export PATH="$HOME/go/bin:$PATH"

Verification

go version
go env GOPATH GOROOT

Example output:

go version go1.26.4 darwin/arm64
~/go
~/sdk/go1.26.4

Removal

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment