用 go build 创建项目,拉取go第三方扩展包的时候报如下错误:
dial tcp 34.64.4.113: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.
解决办法:
- 查看 GOSUMDB 的配置
最后是因为:set GOSUMDB=sum.golang.org
- 关掉GOSUMDB
go env -w GOSUMDB=off
- 配置代理
go env -w GOPROXY=https://goproxy.cn,direct
再次运行项目,依赖下载成功~