张牙舞爪的人,往往是脆弱的。因为真正强大的人,是自信的,自信就会温和,温和就会坚定。
一、基础
gvm,即Go Version Manager,Go版本管理器,使用shell脚本开发,它可以非常轻量的切换Go版本。对比其他语言通常也有类似的工具,如NodeJS的NVM,Python的pyenv等。其原理就是下载不同的Golang安装包,然后放置到独立的目录,使用时将GOROOT和GOPATH指向对应版本的目录即可完成版本切换。
二、使用
安装
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
- curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 9 ms: Connection refused
- 访问
- 设置hosts
185.199.108.133 raw.githubusercontent.com
- curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 9 ms: Connection refused
安装完成后会提示Please restart your terminal session or to get started right away run
source /Users/liuyulong/.gvm/scripts/gvm
常用命令
gvm
- gvm version
- gvm listall
- gvm install
version
HTTP/2 stream 1 was not closed cleanly before end of the underlying stream
- git config –global http.version HTTP/1.1
- git config –global http.postBuffer 524288000
- gvm list
- gvm use
version
- gvm uninstall
version