gv (short for Go Version) is a lightweight, zero-dependency Go version manager for Linux, macOS, and Windows (Git Bash/WSL).
Automatically switches Go version based on go.mod, or manually via gv-use – ideal for multi-project, multi-version development.
- 🚀 One‑line install – fully automated setup
- 🔄 Smart switching – automatically uses the version declared in
go.modwhen youcdinto a project - 🎛️ Manual override – switch to any installed version on demand with
gv-use(add-gto persist across terminals) - 📦 Multi‑version support – each version installed independently
- 🐧 Cross‑platform – Linux, macOS, Windows (Git Bash / WSL)
- 🌏 Multi‑language UI – auto‑detects system language (Simplified/Traditional Chinese, English, Japanese, Korean)
- 🌍 Region‑aware mirror – auto-selects
golang.google.cnfor China,go.devfor other regions; easily changeable viagv-mirror
Open your terminal (Git Bash or WSL on Windows) and run:
curl -sSL https://raw.githubusercontent.com/EchoRealm-io/gv/main/install.sh | bashAfter installation, restart your terminal or run source ~/.bashrc (Linux/macOS) or source ~/.bash_profile to apply.
| Command | Description | Example |
|---|---|---|
gv-install <version> |
Install a specific version | gv-install 1.21.5 |
gv-use [-g] <version> |
Switch version (current session only; add -g to persist for new terminals) |
gv-use 1.20.6 / gv-use -g 1.21.5 |
gv-list |
List installed versions | gv-list |
gv-mirror [set|add <url>] |
Manage download mirrors (list, set primary, add new) | gv-mirror / gv-mirror add https://mirrors.aliyun.com/golang |
gv-help |
Show help and available commands | gv-help |
You can customize settings by editing ~/.go-version-manager/defaults.sh or by setting environment variables.
| Variable | Default (Linux/macOS) | Default (Windows) | Description |
|---|---|---|---|
GO_VERSIONS_DIR |
/usr/local |
$HOME/.go-versions |
Installation root |
GO_DOWNLOAD_BASE_URL |
https://go.dev/dl (auto: golang.google.cn in China) |
same | Download mirror |
DEFAULT_GO_VERSION |
1.26.4 |
same | Fallback version when no go.mod |
MIN_GO_VERSION |
1.21 |
same | Auto‑upgrade versions below this |
| gv | g (voidint) | gvm | asdf | |
|---|---|---|---|---|
| Install | curl | bash |
go install |
bash < <(curl) |
git clone |
| Zero deps | ✅ bash only | ❌ needs Go | ✅ bash | ❌ git+curl |
| Auto-switch | ✅ go.mod | ✅ .go-version | ✅ | ✅ |
| .go-version file | ❌ | ✅ | ✅ | ✅ |
| i18n | ✅ 5 languages | ❌ | ❌ | ❌ |
| Interactive pick | ✅ online | ❌ | ❌ | ❌ |
| Multi-mirror | ✅ auto-fallback | ❌ | ❌ | ❌ |
| SHA256 verify | ❌ | ✅ | ❌ | ✅ |
| Old Go cleanup | ✅ detect & remove | ❌ | ❌ | ❌ |
| Uninstaller | ✅ interactive | ❌ | ❌ | ❌ |
| Windows native | ❌ Git Bash/WSL | ✅ native | ❌ | |
| Multi-language | ❌ Go only | ❌ Go only | ❌ Go only | ✅ any |
| Startup speed | ✅ binary | ✅ shell func | ||
| Persist version | ✅ gv-use -g |
✅ | ✅ | ✅ |
curl -sSL https://raw.githubusercontent.com/EchoRealm-io/gv/main/uninstall.sh | bashThe uninstaller will guide you through removing Go versions, gv files, and shell config entries.
MIT
