When downloading various dependencies through
go get
commands, you often need to visit websites such as github/google. If you use the default proxy, the download speed is very slow, or even impossible to download. In this case, you need to set up a domestic proxy to achieve efficient downloading
Commonly used GO agents in China
goproxy
Qiniu Yun
Ali Cloud
https://mirrors.aliyun.com/goproxy/
set proxy
Go version is 1.13 and above
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
other versions
export GO111MODULE=on
export GOPROXY=https://goproxy.cn
cancel proxy
go env -u GOPROXY
View GO configuration
go env
//以JSON格式输出
go env -json