用过go的同学都知道go get …… 是一个漫长的过程,既然python 有pip国内镜像,node 也有国内镜像,那go是否有类似的镜像呢?确实有go mod + goproxy 可参考 http://mirrors.aliyun.com/goproxy/ ,具体怎实现呢?
-
在环境变量中加入GOPROXY值为 https://mirrors.aliyun.com/goproxy/
-
新建一个文件夹test
-
在test下执行go mod init test
-
go get -u -v github.com/gin-gonic/gin