go env -w GO111MODULE=on go env -w GOPROXY=https://goproxy.io
https://goproxy.io 也可替换成阿里的 https://mirrors.aliyun.com/goproxy或https://goproxy.cn
export GO111MODULE=on export GOPROXY=https://goproxy.cn
或者
echo "export GO111MODULE=on" >> ~/.profile echo "export GOPROXY=https://goproxy.cn" >> ~/.profile source ~/.profile