go proxy settings

In Go 1.13, we can GOPROXYcontrol the agents, and by GOPRIVATEnot walking proxy control private library.

Setting GOPROXYAgent:

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

Arranged GOPRIVATEto skip a private library, such as conventional Gitlabor Giteemiddle separated by commas:

go env -w GOPRIVATE=*.gitlab.com,*.gitee.com

If you are running go mod vendorwhen prompted Get https://sum.golang.org/lookup/xxxxxx: dial tcp 216.58.200.49:443: i/o timeout, it is because the default settings Go 1.13 GOSUMDB=sum.golang.org, this site is a wall, and used to verify the validity of the package can be closed with the following command:

go env -w GOSUMDB=off

 

You can set GOSUMDB = "sum.golang.google.cn", this is the sum verification services specifically for the domestic offer.

go env -w GOSUMDB="sum.golang.google.cn"
 

Guess you like

Origin www.cnblogs.com/lijiejoy/p/11520944.html
Recommended