1.下载go1.4-bootstrap
wget https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gztar -zxvf go1.4-bootstrap-20171003.tar.gz
2.配置GOROOT_BOOTSTRAP
vim /etc/profile.d/go1.4-bootstrap.shexport GOROOT_BOOTSTRAP=/usr/local/src/go1.4-bootstrapexport CGO_ENABLED=0source /etc/profile
3.装置go1.4-bootstrap
cd go1.4-bootstrap/src./make.bash
4.源码装置go
wget https://golang.google.cn/dl/go1.16.2.src.tar.gztar -zxvf go1.16.2.src.tar.gzcd go/src./all.bash
5. 配置环境变量
vim /etc/profile.d/go.shexport $GOROOT=/usr/local/soft/goexport $GOPATH=/workspace/goexport PATH=$PATH:$GOROOT/binexport GOPROXY=https://goproxy.cn,direct