Goproxy China official website: https://goproxy.cn/
GitHub: https://github.com/goproxy/goproxy.cn
usage
Go 1.13 and above (recommended)
Open your terminal and execute
$ go env -w GO111MODULE=on
$ go env -w GOPROXY=https://goproxy.cn,direct
carry out.
macOS or Linux
Open your terminal and execute
$ export GO111MODULE=on
$ export GOPROXY=https://goproxy.cn
or
$ echo "export GO111MODULE=on" >> ~/.profile
$ echo "export GOPROXY=https://goproxy.cn" >> ~/.profile
$ source ~/.profile
carry out.
Windows
Open your PowerShell and execute
C:\> $env:GO111MODULE = "on"
C:\> $env:GOPROXY = "https://goproxy.cn"
or
- Open "Start" and search for "env"
- Select "Edit System Environment Variables"
- Click the "Environment Variables..." button
- Under the section "User Variables of <your username>" (the upper part)
- Click the "New..." button
- Select the "Variable Name" input box and enter "GO111MODULE"
- Select the "variable value" input box and enter "on"
- Click the "OK" button
- Click the "New..." button
- Select the "Variable Name" input box and enter "GOPROXY"
- Select the "variable value" input box and enter "https://goproxy.cn"
- Click the "OK" button
carry out.