GVM is a tool for managing multiple Go versions. It supports Windows, Linux, and macOS systems.
- Install multiple Go versions
- Switch between different Go versions
- List installed Go versions
- List remote available Go versions
- Uninstall unnecessary Go versions
Download the appropriate gvm executable for your system and place it in your environment's PATH.
# Install a specific Go version
gvm install 1.24.0
# Switch to a specific Go version
gvm use 1.24.0
# List installed Go versions
gvm ls
# List remote available Go versions
gvm ls-remote
# Uninstall a specific Go version
gvm uninstall 1.24.0
# Display help information
gvm helpgo build -o gvm main.go$GVM_ROOT:GVM working directory.$GVM_ROOT/versions:Go version installation directory. Each version of Go is installed in a separate subdirectory.$GVM_ROOT/archives: Go version archive files.$GVM_ROOT/current: Go current executable directory.
current directory is a symbolic link pointing to the executable directory of the currently used Go version in the versions directory.
GVM_ROOT: GVM working directory.
Add the source lines from the snippet below to the correct profile file (~/.bashrc, ~/.bash_profile, ~/.zshrc, or ~/.profile):
export GVM_ROOT="$HOME/.gvm"
export PATH=$PATH:$GVM_ROOT/current/binAdd the following lines to your environment variables:
GVM_ROOT: Add the GVM working directory to the environment variables. (default:%APPDATA%\gvm)PATH: Add%GVM_ROOT%\current\binto the PATH variable.
Contributions are welcome! Please submit a pull request or open an issue to discuss any changes.
MIT License