go proxy settings

When downloading various dependencies through go getcommands, 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

https://goproxy.io/zh/

Qiniu Yun

https://goproxy.cn

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

Guess you like

Origin blog.csdn.net/qq_40790680/article/details/128971688