Go语言的包的代理的配置

May 22, 2025

配置中国Golang语言的包镜像

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

现在,当你构建你Golnag应用时,Go将会获取通过 goproxy.io获取包,如果你想持久化环境变量,请执行以下命令,如果你使用的Golang版本< 1.13,请升级Go到最新版本,请阅读文档如何安装Go最新版本。 zsh

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

zsh bash

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