go get 安装包时候报错,需要修改go proxy

go get connectex: A connection attempt failed because the connected party did not properly respond


今天 go get 时出现了截图中的这个问题:


go: finding module for package github.com/Sirupsen/logrus
csphere-test/my-log imports
        github.com/Sirupsen/logrus: module github.com/Sirupsen/logrus: Get "https://proxy.golang.org/github.com/%21sirupsen/logrus/@v/list": dial tcp 172.217.160.81: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 env 

猜你喜欢

转载自blog.csdn.net/qq_42533216/article/details/121383502