Go Version Manager
-
Set up gvm and Go environments (only need to set once)
- linux/mac (mac needs to be allowed in setting security):
./gvm setup
- windows:
gvm.exe setup
- linux/mac (mac needs to be allowed in setting security):
-
Set the download Go source (optional)
- view common source:
gvm mirror
- set source:
gvm mirror url
- example:
gvm mirror https://mirrors.aliyun.com/golang
- example:
- view common source:
-
Specify the version to install Go (example: 1.22.2)
gvm install 1.22.2
-
View the current Go version
gvm version
-
Install other versions of Go (example: 1.22.1)
gvm install 1.22.1
-
Switch Go version
gvm use 1.22.2