今天在安装beego的时候,为了方便的生成框架,输入go get -u -v github.com/beego/bee,如下图,报错信息如下:
go get: module github.com/beego/bee: Get "https://proxy.golang.org/github.com/beego/bee/@v/list": dial tcp 142.251.42.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