Go 设置国内镜像源

Go 设置国内镜像源

https://goproxy.cn

用法:

打开terminal执行以下语句

go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct

或者更改环境变量

 echo "export GO111MODULE=on" >> ~/.profile
 echo "export GOPROXY=https://goproxy.cn" >> ~/.profile
 source ~/.profile
posted @ 2021-04-28 16:09  休辞醉倒  阅读(3740)  评论(0)    收藏  举报