LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

goenv

Go version manager

TLDR

List available Go versions
$ goenv install -l
copy
Install a Go version
$ goenv install [1.21.0]
copy
Install the latest stable version
$ goenv install latest
copy
List installed versions
$ goenv versions
copy
Set global Go version
$ goenv global [1.21.0]
copy
Set local version for directory
$ goenv local [1.21.0]
copy
Show current version
$ goenv version
copy
Uninstall a version
$ goenv uninstall [1.21.0]
copy

SYNOPSIS

goenv command [args]

DESCRIPTION

goenv is a Go version manager inspired by rbenv and pyenv. It allows installing multiple Go versions side by side and switching between them per-project or globally.Version selection is managed through .go-version files and shims that intercept Go commands, routing them to the appropriate version.

PARAMETERS

-l, --list

List available versions for install.

CONFIGURATION

~/.goenv/version

Global Go version setting.
.go-version
Per-directory Go version override file.
GOENV_ROOT
Environment variable specifying the goenv installation directory (default ~/.goenv).

SUBCOMMANDS

install version

Install a Go version.
uninstall version
Uninstall a Go version.
versions
List installed versions.
version
Show current active version.
global version
Set global default version.
local version
Set directory-specific version (writes a `.go-version` file).
shell version
Set a shell-specific version via the `GOENV_VERSION` variable.
which command
Show the full path to the executable that goenv will invoke.
rehash
Rebuild shim executables.
init
Configure shell environment.

INSTALL

brew install goenv
copy

SEE ALSO

go(1), pyenv(1), rbenv(1)

Copied to clipboard
Kai