國內(nèi)beego學(xué)習(xí)時(shí)使用go get不可用或者網(wǎng)速較慢時(shí):
國內(nèi)使用go get時(shí)迫筑,如果沒有進(jìn)行過設(shè)置是無法很流暢的使用的娶视,需要對go中的環(huán)境變量進(jìn)行設(shè)置峭火,下面條命令可直接使用钥庇。
1.命令一
go env -w GO111MODULE=on
2.命令二
設(shè)置環(huán)境代理
go env -w GOPROXY=https://goproxy.cn,direct
3.命令三
添加環(huán)境變量并且立即生效
echo "export GOPROXY=https://goproxy.cn" >> ~/.profile && source ~/.profile