当前位置:   article > 正文

go执行go mod tidy时报错连接失败(go换依赖源)

go执行go mod tidy时报错连接失败(go换依赖源)

报错:

go: cloud.google.com/go@v0.41.0: Get "https://proxy.golang.org/cloud.google.com/go/@v/v0.41.0.mod": dial tcp 142.251.43.17: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.

报错如上,大概就是安装依赖时从上述网址访问失败,一般是由于国内防火墙导致的,这个不可避免,所以可以用梯子,或者修改依赖获取的源,类似Python的换源,在cmd里面执行:

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

完成之后,再执行go mod tidy就很快了~

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/291376
推荐阅读
相关标签
  

闽ICP备14008679号