๐ The Fast and Simple Go Version Manager for Developers
Installation โข Quick Start โข Features โข FAQ โข ๐ Documentation
Note: The master branch may be under development and is not a stable version. Please download the source code of a stable version via a tag, or download the compiled binary from releases.
gvm is a lightweight command-line tool for Linux, macOS, and Windows that provides convenient management and switching of multiple versions of Go. ๐ฏ
- ๐ Blazing Fast - Quick installation and switching between Go versions
- ๐ Seamless Switching - Switch between Go versions with a single command
- ๐ Cross-Platform - Works on Linux, macOS, and Windows
- ๐ Secure - Automatic checksum verification for all downloads
- ๐พ Space Efficient - Download once, install multiple versions
- ๐ ๏ธ Smart Features - macOS version compatibility detection, PATH validation, and more
Linux / macOS
curl -sSL https://raw.githubusercontent.com/tekintian/gvm/master/install.sh | bashWindows
# Download from releases and run the installer
# See https://github.com/tekintian/gvm/releases- Download the binary from releases
- Extract to a directory in your
PATH(e.g.,/usr/local/bin) - Add to your shell profile (
~/.bashrcor~/.zshrc):
cat >> ~/.bashrc <<'EOF'
export GOROOT="${HOME}/.gvm/go"
export PATH="${HOME}/.gvm/go/bin:$PATH"
export GVM_MIRROR=https://golang.google.cn/dl/
EOF- Reload your shell:
source ~/.bashrc# List available stable versions
gvm ls-remote stable
# Install Go 1.21.0
gvm install 1.21.0
# List installed versions
gvm ls
# Switch to Go 1.21.0
gvm use 1.21.0
# Verify the version
go version# List stable versions only
gvm ls-remote stable
# List all available versions (including beta, rc, archived)
gvm ls-remote
# List specific channel
gvm ls-remote rc
gvm ls-remote beta# Install specific version
gvm install 1.21.0
# Install with short version (gvm will auto-match 1.21.0)
gvm install 1.21# List all installed versions
gvm ls
# Switch to a version
gvm use 1.21.0
# Uninstall a version
gvm uninstall 1.21.0# Check for updates
gvm update- โ List available Go versions for installation
- โ List installed Go versions
- โ Install multiple Go versions locally
- โ Uninstall installed Go versions
- โ Switch freely between installed Go versions
- โ Self-update support (>= 1.3.0)
- โ Cross-platform support (Linux, macOS, Windows)
- โ macOS version compatibility detection
- โ Duplicate version filtering
- โ Complete version display (e.g., 1.24.0)
- โ
Short version matching (e.g.,
1.24matches1.24.0) - โ PATH configuration validation
- โ Network proxy support
- โ Checksum verification
| Platform | Architectures | Minimum OS Version |
|---|---|---|
| Linux | 386, amd64, arm, arm64, s390x | All distributions |
| macOS | amd64, arm64 | 10.13+ (Intel), 11.0+ (ARM) |
| Windows | 386, amd64, arm, arm64 | Vista+ |
| Variable | Description | Default |
|---|---|---|
GVM_MIRROR |
Mirror site for downloading Go | - |
GVM_HOME |
Custom home directory for gvm | ~/.gvm |
GVM_EXPERIMENTAL |
Enable experimental features | false |
If you're in China or need faster downloads, use one of these mirrors:
export GVM_MIRROR=https://golang.google.cn/dl/
# or
export GVM_MIRROR=https://studygolang.com/dl
# or
export GVM_MIRROR=https://mirrors.aliyun.com/golang/# Pull the image
docker pull tekintian/gvm:latest
# Run gvm in container
docker run --rm -v gvm-data:/root/.gvm tekintian/gvm ls-remote
# Using docker-compose
docker-compose up -d
docker-compose exec gvm gvm install 1.21.0- Multiple versions: Install and switch between multiple Go versions easily
- Fast switching: Switch versions with a single command
- No manual setup: Automatic PATH configuration and symlink management
- Cross-platform: Works consistently across Linux, macOS, and Windows
Due to access restrictions to the official Go website in some regions, querying and downloading Go versions can be difficult. This environment variable allows you to specify one or more mirror sites (separated by commas). gvm will query and download available Go versions from these sites.
When this environment variable is set to true, all experimental features are enabled.
By convention, gvm uses the ~/.gvm directory as its home directory. If you want to customize the home directory, you can use this environment variable to switch to another directory. Since this feature is still experimental, you need to enable GVM_EXPERIMENTAL=true for it to take effect.
The official Go website only added support for ARM architecture macOS systems in version 1.16. Therefore, Go installation packages version 1.15 and below cannot be installed on ARM architecture macOS systems.
Yes. You can set network proxy addresses in HTTP_PROXY, HTTPS_PROXY, http_proxy, https_proxy environment variables.
Since the implementation of gvm depends on symbolic links, the operating system must be Windows Vista or higher.
This may be because the downloaded installation was not added to $PATH. You need to manually include $PATH in the user's environment variables. For convenience, run the PowerShell script path.ps1 provided in the project and restart your computer.
No, it does not support building from source.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Thanks to these amazing projects for providing valuable ideas:
Made with โค๏ธ by TekinTian