解决go包管理代理网址无法访问:proxy.golang.org

转载 学习 GO
阅读数: 910 2021年01月24日

安装 bee 工具运行的时候报错:

2021/01/24 23:29:14 INFO     ? 0002 Initializing watcher...
go: github.com/beego/beego/v2@v2.0.1: Get "https://proxy.golang.org/github.com/beego/beego/v2/@v/v2.0.1.mod": dial tcp 216.58.200.241:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
2021/01/24 23:29:56 ERROR    ? 0003 Failed to build the application: go: github.com/beego/beego/v2@v2.0.1: Get "https://proxy.golang.org/github.com/beego/beego/v2/@v/v2.0.1.mod": dial tcp 216.58.200.241:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

因为:默认使用的是proxy.golang.org,在国内无法访问


解决方法:

换一个国内能访问的代理地址:https://goproxy.cn

执行命令:

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

重新执行命令,完美通过!


参考资料
https://www.cnblogs.com/haojile/p/13144030.html
phpriji.cn | 网站地图 | 沪ICP备17015433号-1