Go修改ENV代理GoProxy解决运行官方样例代码无法获得模块的问题

问题解构三步走

1.认识问题

现场日志

Get "https://proxy.golang.org/rsc.io/quote/@v/list": dial tcp 172 .217.163.49: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.分析问题

通过日志找线索,原因可能是连接超时或建立连接失败。

3.解决问题

通过 env 修改代理服务器 GoProxy

E:\go\hello>go env -w GOPROXY=https://goproxy.cn

原文

猜你喜欢

转载自blog.csdn.net/shupili141005/article/details/127803546