LinuxCommandLibrary

goenv

Go version manager

TLDR

List available Go versions

$ goenv install -l
copy
Install a Go version
$ goenv install [1.21.0]
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.
rehash
Rebuild shim executables.
init
Configure shell environment.

SEE ALSO

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

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community