~/go/shims/go and ~/go/shims/gofmt. When your shell’s PATH has ~/go/shims before any other Go binary, every go command passes through the shim first.
How version resolution works
The shim walks up the directory tree from your current working directory, checking for a version specifier at each level:Check for .go_version
If a
.go_version file exists in the current or any parent directory, its contents are used as the Go version.Check go.mod
If a
go.mod file exists, the shim reads the go directive line (e.g. go 1.23.4). If the version has only two parts (e.g. 1.23), the shim appends .0 to make it 1.23.0. If the bump tool is installed, it uses bump to normalize the version.Fall back to global version
If no per-project version file is found, the shim reads
~/go/version for the globally active version.Shim source
Thego shim (~/go/shims/go) is embedded in the igo binary and written to disk during igo -i. Here is the full script:
shim.go.sh
Per-project version pinning
Create a.go_version file in your project root to pin a specific Go version:
.go_version before reading go.mod, so this file takes precedence. This is useful when your go.mod specifies a two-part version like go 1.23 but you want to pin to a specific patch release.
PATH ordering
For shims to work correctly,~/go/shims must appear before any other Go binary in PATH. The igo activator script (~/.igo) ensures this ordering:
source ~/.igo comes after those entries in your shell config so igo’s shims take precedence.