運行檔案時報錯 verifying github.com/mattn/[email protected]/go.mod: github.com/mattn/[email protected]/go.mod: Get https://sum.golang.org/lookup/github.com/mattn/[email protected]: dial tcp 216.58.200.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.
verifying github.com/onsi/[email protected]/go.mod: github.com/onsi/[email protected]/go.mod: Get https://sum.golang.org/lookup/github.com/onsi/[email protected]: dial tcp 216.58.200.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.
verifying github.com/mattn/[email protected]/go.mod: github.com/mattn/[email protected]/go.mod: Get https://sum.golang.org/lookup/github.com/mattn/[email protected]: dial tcp 216.58.200.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.

在Go 1.13中,我們可以通過GOPROXY來控制代理
注意 : 通過 GOPRIVATE 控制私有庫不走代理
這個網站是被墻了的,用于驗證包的有效性,可以通過如下命令關閉:
go env -w GOSUMDB=off
私有倉庫自動忽略驗證
可以設定 go env -w GOSUMDB="sum.golang.google.cn", 這個是專門為國內提供的sum 驗證服務
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/51198.html
標籤:Go
上一篇:Go網路編程
