首页 > 其他分享 >go下载依赖提示连接失败

go下载依赖提示连接失败

时间:2022-12-30 18:24:28浏览次数:51  
标签:respond 依赖 GOSUMDB failed env go 下载

1、现象

Go下载模块提示连接失败

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.

 2、解决办法

①查看go env中的GOSUMDB变量

go env

 ②关闭GOSUMDB

go env -w GOSUMDB=off

 ③设置代理为https://goproxy.cn,direct

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

 

 ④再次下载

标签:respond,依赖,GOSUMDB,failed,env,go,下载
From: https://www.cnblogs.com/siyunianhua/p/17015550.html

相关文章