跳至主要內容

go项目构建问题

程序员李某某小于 1 分钟

go项目构建问题

依赖拉不下来

go 项目库更新版本出现如下问题:

Get "https://proxy.golang.org/github.com/stretchr/testify/@v/v1.7.1.zip": 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.

这个错误看起来是由于无法连接到代理服务器导致的。这可能是由于网络问题或代理服务器问题引起的。网络连接正常,多次尝试后问题仍然存在。 出现上面报错的原因是因为当你执行命令的时候回去国外的仓库下载你需要的包,但是被防火墙拦截了,你只需要更换一下代理就可以.

执行如下命令:

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

再执行下面命令验证:

go get -u && go mod tidy
上次编辑于:
贡献者: 李元昊