用过go的同学都知道go get …… 是一个漫长的过程,既然python 有pip国内镜像,node 也有国内镜像,那go是否有类似的镜像呢?确实有go mod + goproxy 可参考 http://mirrors.aliyun.com/goproxy/ ,具体怎实现呢?

  1. 在环境变量中加入GOPROXY值为 https://mirrors.aliyun.com/goproxy/

  2. 新建一个文件夹test

  3. 在test下执行go mod init test

  4. go get -u -v github.com/gin-gonic/gin