/goenv

:blue_car: Like pyenv and rbenv, but for Go.

Primary LanguageShellMIT LicenseMIT

Go Version Management: goenv

Build Status

goenv aims to be as simple as possible and follow the already established successful version management model of pyenv and rbenv.

This project was cloned from pyenv and modified for Go.

asciicast

goenv does...

  • 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.

goenv compared to others:


Links


Environment variables

You can affect how goenv operates with the following settings:

name default description
GOENV_VERSION Specifies the Go version to be used.
Also see goenv help shell.
GOENV_ROOT ~/.goenv Defines the directory under which Go versions and shims reside.
Current value shown by goenv root.
GOENV_DEBUG Outputs debug information.
Also as: goenv --debug <subcommand>
GOENV_HOOK_PATH Colon-separated list of paths searched for goenv hooks.
GOENV_DIR $PWD Directory to start searching for .go-version files.

Development

The goenv source code is hosted on GitHub. It's clean, modular, and easy to understand, even if you're not a shell hacker. (I hope)

Tests are executed using Bats:

$ make test

Please feel free to submit pull requests and file bugs on the issue tracker.