← 返回命令列表

Linux command

goenv 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List available Go versions

goenv install -l

Install a Go version

goenv install [1.21.0]

List installed versions

goenv versions

Set global Go version

goenv global [1.21.0]

Set local version for directory

goenv local [1.21.0]

Show current version

goenv version

Uninstall a version

goenv uninstall [1.21.0]

说明

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.

参数

-l, --list
List available versions for install.

FAQ

What is the goenv command used for?

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.

How do I run a basic goenv example?

Run `goenv install -l` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -l, --list do in goenv?

List available versions for install.