GOPROXY代理 invalid $GOPROXY setting error

Go 由于是谷歌研发出品,很多开源依赖包都在国外服务器,down包经常会出现当不下来的情况,此时就需要设置$GOPROXY 代理,通过国内代理链接来获取包资源。

常用代理路径:GOPROXY.IO - A Global Proxy for Go Modules

网站打开很直白的介绍了如何设置$GOPROXY变量。

In Linux or macOS, you can execute the below commands.
Bash /
# Enable the go modules feature
export GO111MODULE=on
# Set the GOPROXY environment variable
export GOPROXY=https://goproxy.io
Or, write it into the .bashrc or .bash_profile file.
In Windows, you can execute the below commands.
PowerShell 
# Enable the go modules feature
$env:GO111MODULE=on
# Set the GOPROXY environment variable
$env:GOPROXY=https://goproxy.io
Now, when you build and run your applications, go will fetch dependencies via goproxy.io. See more information in the goproxy repository.
If your Go version >= 1.13, the GOPRIVATE environment variable controls wh
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值