本文主要是介绍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就很快了~
这篇关于go执行go mod tidy时报错连接失败(go换依赖源)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!