最近在学golang,由于文化自信,Go语言好多包国内是没法获取的,写这篇教程但愿能够帮助你们最快的解决资源被墙的问题,不要把时间浪费这种无心义的事情上.golang
$ go version # go version go1.12 darwin/amd64
复制代码
$ vim .bash_profile
复制代码
加上export GO111MODULE=on
export GOPROXY=https://goproxy.io
复制代码
保存退出;source ~/.bash_profile
;使刚才的修改当即生效;go env
;若是看到GOPROXY="https://goproxy.io"
则配置成功;