golang添加代理下载加速

linux/mac

设置你的 bash 环境变量

echo "export GOPROXY=https://goproxy.io,direct" >> ~/.profile && source ~/.profile

如果你的终端是 zsh,使用以下命令

echo "export GOPROXY=https://goproxy.io,direct" >> ~/.zshrc && source ~/.zshrc

windows

  1. 右键 我的电脑 -> 属性 -> 高级系统设置 -> 环境变量
  2. 在 “[你的用户名]的用户变量” 中点击 ”新建“ 按钮
  3. 在 “变量名” 输入框并新增 “GOPROXY”
  4. 在对应的 “变量值” 输入框中新增 “https://goproxy.io,direct”
  5. 最后点击 “确定” 按钮保存设置
posted @ 2022-04-17 20:25  甜甜太阳雨  阅读(381)  评论(0)    收藏  举报