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 @ 2022-03-19 17:13  micr067  阅读(2381)  评论(0编辑  收藏  举报