今天在安装beego的时候,运行go get -u github.com/beego/bee/v2,报错信息如下:
go get: module github.com/beego/bee/v2: Get "https://proxy.golang.org/github.com/beego/bee/v2/@v/list": dial tcp 172.217.31.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.
解决办法:
设置代理地址: https://goproxy.cn
运行命令即可:
go env -w GOPROXY=https://goproxy.cn
然后在运行go get 就可以正常下载了。
顺带一提:如果安装的速度过慢,可尝试以下办法:
修改本机hosts文件,添加下面2行代码即可。
140.82.114.3 github.com
199.232.5.194 github.global.ssl.fastly.net
参考网址:
https://m.php.cn/blog/detail/25007.html
https://blog.csdn.net/weixin_41782332/article/details/103226874