用vscode开发go的时候,安装go包报错,就找到了这篇文章,改一个配置,设置代理就好了。记录一下
一、问题
用 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 的配置
go env
- 1
最后是因为:set GOSUMDB=sum.golang.org
把它关掉
go env -w GOSUMDB=off
- 1
代理推荐
go env -w GOPROXY=https://goproxy.cn,direct
- 1
再次执行命令 go build
,成功~
版权声明:本文为qq_36025814原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:dial tcp 34.64.4.113:443: connectex: A connection attempt failed because the connected party did not_夏已微凉、-CSDN博客dial tcp 34.64.4.113:443: connectex: A connection attempt failed because the connected party did not_夏已微凉、-CSDN博客