解決go包管理代理網址無法訪問:proxy.golang.org


默認使用的是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

重新執行命令,完美通過!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM