go Get TimeOut macwinlinux 处理办法 “https:proxy.golang.orggithub.com

go Get TimeOut macwinlinux 处理办法 “https:proxy.golang.orggithub.com,第1张

问题原因:

连接到proxy.golang.org/github.com这个网址,网络超时了。

解决办法:

使用中国区的镜像或者代理。

镜像:就是把外国的站点一比一的复制到国内服务器上,直接访问这个国内服务器速度就会快很多。

代理:就是连接到一个能够快速访问这个超时网址的服务器,让这个服务器将请求转发到目标网址上。🐴🐴🐴 哒哒哒 然后就链接上了。

具体实现:

Linux/MacOS:

go env -w GOPROXY=https://goproxy.cn,direct

Windows:

Windows设置

In Windows, you can execute the below commands.(在Windows中,你可以执行下面的命令)

# Enable the go modules feature
$env:GO111MODULE="on"
# Set the GOPROXY environment variable
$env:GOPROXY="https://goproxy.io"


 

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/995575.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-21
下一篇 2022-05-21

发表评论

登录后才能评论

评论列表(0条)

保存