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

 

 ④再次下載

 參考連接: https://blog.csdn.net/qq_37767455/article/details/121188740


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM