go proxy

Go Version requirement

We recommend you upgrade Go to the latest version ( >= Go1.13 ), you can upgrade Go here.

Set GOPROXY environment

Bash (Linux or macOS)

export GOPROXY=https://goproxy.io,direct

PowerShell (Windows)

$env:GOPROXY = "https://goproxy.io,direct"

Add Environments in your profile (RECOMMEND)

Mac/Linux

# add environment to your profile
echo "export GOPROXY=https://goproxy.io,direct" >> ~/.profile && source ~/.profile

# if your terminal is zsh,type the command below
echo "export GOPROXY=https://goproxy.io,direct" >> ~/.zshrc && source ~/.zshrc

Windows

1. Right click This PC -> Properties -> Advanced system settings -> Environment Variables
2. Click "New" in Environment Variables
3. Input Variable Name: “GOPROXY”
4. Input Variable Value: “https://goproxy.io,direct”
5. Click "OK", save your settings.

 

GoLand configuration goproxy

When we use GoLand for development, we can configure goproxy to pull the required dependent code.

Configuration path: GoLand --> Perferences --> Go --> Go Modules(vgo)--> Proxy

write in proxy https://goproxy.io,direct , restart after modify. The details are as follows:

goland-preferences

goland-proxy

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章