window
在环境变量增加GOPROXY
值为
https://mirrors.aliyun.com/goproxy/
或者
https://goproxy.cn
linux
vim /etc/profile
增加
export GOPROXY=https://goproxy.cn/
export GOPROXY=https://mirrors.aliyun.com/goproxy/
使环境变量生效
source /etc/profile