安装yum源

yum install epel-release -y

安装Go程序

yum install golang

设置代理

一次性生效

export GOPROXY=https://goproxy.cn

永久生效

echo "export GOPROXY=https://goproxy.cn" >> ~/.profile && source ~/.profile