https://github.com/moovweb/gvm
安装
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
使用
source ~/.gvm/scripts/gvm
gvm listall
# gvm 默认从 github 克隆代码到本地,然后进行编译
# 可以采用 gitee 仓库加速
git clone git@gitee.com:mirrors/go ~/.gvm/archive/go
gvm install go1.16
gvm list
gvm use go1.16
go version
# go version go1.16 linux/amd64