LinuxmacOS

Where Does goenv Store Go Versions?

goenv installs each Go toolchain into ~/.goenv/versions and switches between them with shims plus a global version file.

Last updated

goenv gives Go the version-manager treatment its official releases never had. Each toolchain unpacks into its own folder under ~/.goenv/versions, and shims for go, gofmt, and friends route to the selected one. The global choice lives in ~/.goenv/version.

Project pins work through .go-version files, the same convention other managers use. Your GOPATH and module cache sit outside goenv entirely, so switching toolchains never disturbs built artifacts. Binaries you installed keep working across switches, since only the compiler changes.

Where goenv stores this, by platform

Linux
~/.goenv/versions

One folder per Go toolchain plus shims and the global version file. .go-version files in projects override the global pick. GOPATH and module cache live elsewhere by design.

macOS
~/.goenv/versions

Same layout on macOS for Intel and Apple silicon. The shims directory must stay on PATH or version switching silently stops working.

Frequently asked questions

Which Go toolchain is active in this folder?

Run goenv versions for installed toolchains and goenv version for the resolved pick. A .go-version file in the project beats the global file, which beats the system Go.

Does removing a version delete my Go modules?

Delete the version folder under versions, or run goenv uninstall. Modules you built stay in your GOPATH and module cache, which goenv never touches.

Notice an outdated path? Let us know.