📢 Version Note: goenv v3 is now the current stable version. v2 remains available as
goenv@2for legacy support. See Version Support Policy below.
goenv aims to be as simple as possible and follow the already established successful version management model of pyenv and rbenv.
New go versions are added automatically on a daily CRON schedule.
This project was cloned from pyenv and modified for Go.
- Let you change the global Go version on a per-user basis.
- Provide support for per-project Go versions.
- Allow you to override the Go version with an environment variable.
- Search commands from multiple versions of Go at a time.
- https://github.com/crsmithdev/goenv depends on Go,
- https://github.com/moovweb/gvm is a different approach to the problem that's modeled after
nvm.goenvis more simplified.
goenv v3 is the current stable release and is recommended for all new installations. It features:
- Complete rewrite from shell scripts to Go-based CLI for improved performance and reliability
- Full backward compatibility with v2
- Active development and feature updates
Installation:
# Homebrew (macOS/Linux)
brew install goenv
# Manual installation
git clone https://github.com/go-nv/goenv.git ~/.goenvgoenv v2 is maintained for legacy support with a minimum 2-year commitment (until December 2028 or End of Support, whichever comes first). During this period, v2 will receive:
- Security patches and critical bug fixes
- Maintenance through the
masterbranch - Support for existing production deployments
When to use v2:
- AWS CodeBuild and CI systems with existing v2 dependencies
- Production systems requiring additional validation time before migrating to v3
- Docker containers that haven't yet been updated to v3
Installation:
# Homebrew - versioned formula
brew install goenv@2 && brew link goenv@2
# Manual installation - v2 branch
git clone -b master https://github.com/go-nv/goenv.git ~/.goenvMigration: v3 is fully backward compatible with v2. Most users can migrate immediately without changes. See our migration guide for details.
End of Support Date: v2 support will be discontinued on or before December 31, 2028.
The following snippet can be inserted in your buildspec.yml (or buildspec definition) for AWS CodeBuild. It's recommended to do this during the pre_build phase.
Side Note: if you use the below steps, please unset your golang version in the buildspec and run the installer manually.
- (cd /root/.goenv/plugins/go-build/../.. && git pull)