golang 代理問題

解決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/[email protected]: 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 重新執行命令,完美通過!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章