yum install go -y
mkdir -p /data/go
echo export GO111MODULE=on >> /etc/profile
echo export GOPATH=/data/go >> /etc/profile
echo export GOPROXY=https://goproxy.io >> /etc/profile
source /etc/profile
git clone https://github.com/golang/sys.git $GOPATH/src/github.com/golang/sys
git clone https://github.com/golang/net.git $GOPATH/src/github.com/golang/net
git clone https://github.com/golang/text.git $GOPATH/src/github.com/golang/text
git clone https://github.com/golang/lint.git $GOPATH/src/github.com/golang/lint
git clone https://github.com/golang/tools.git $GOPATH/src/github.com/golang/tools
git clone https://github.com/golang/crypto.git $GOPATH/src/github.com/golang/crypto
git clone https://github.com/golang/sync.git $GOPATH/src/github.com/golang/sync
git clone https://github.com/golang/time.git $GOPATH/src/github.com/golang/time
git clone https://github.com/golang/image.git $GOPATH/src/github.com/golang/image
ln -s $GOPATH/src/golang.org/x $GOPATH/src/github.com/golang/
有疑问加站长微信联系(非本文作者)