查看: 100|回复: 0

解决go包管理代理网址无法访问:proxy.golang.org

[复制链接]

1

主题

0

回帖

0

积分

热心网友

金币
0
阅读权限
220
精华
0
威望
0
贡献
0
在线时间
0 小时
注册时间
2009-11-27
发表于 2020-6-16 19:52:00 | 显示全部楼层 |阅读模式

默认使用的是proxy.golang.org,在国内无法访问,如下图所示:

bogon:demo-path user$ make build_darwin
rm -rf target/demo-0.6.0 
mkdir -p target/demo-0.6.0/bin 
env CGO_ENABLED=1 GO111MODULE=on go run build/spec.go target/demo-0.6.0/bin/demo-spec-0.6.0.yaml
go: github.com/StackExchange/wmi@v0.0.0-20190523213315-cbe66965904d: Get "https://proxy.golang.org/github.com/%21stack%21exchange/wmi/@v/v0.0.0-20190523213315-cbe66965904d.mod": dial tcp 34.64.4.17:443: i/o timeout
make: *** [build_yaml] Error 1
bogon:demo-path user$ make build_darwin

解决方法:

换一个国内能访问的代理地址:https://goproxy.cn

执行命令:

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

重新执行命令,完美通过!



来源:https://www.cnblogs.com/haojile/p/13144030.html
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部