In Go 1.13, we can GOPROXY
control the agents, and by GOPRIVATE
not walking proxy control private library.
Setting GOPROXY
Agent:
go env -w GOPROXY=https://goproxy.cn,direct
Arranged GOPRIVATE
to skip a private library, such as conventional Gitlab
or Gitee
middle separated by commas:
go env -w GOPRIVATE=*.gitlab.com,*.gitee.com
If you are running go mod vendor
when 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"