golang安装第三方包总是被墙,如下方法可以解决该问题,亲测有效!
设置 GO111MODULE 和 GOPROXY。加入(一般有Athens和goproxy.io。goproxy.cn这个在国内速度不错)。
mac或linux在/etc/profile文件内加入以下两句:
export GO111MODULE=on
export GOPROXY=https://goproxy.cn
转载自https://blog.csdn.net/luhuimao/article/details/108381446。