golang 1.13 解决go get 无法下载问题

参考:https://www.sunzhongwei.com/problem-of-domestic-go-get-unable-to-download?from=sidebar_new

安装golang gin 依赖包的时候,长时间无响应,最后报如下错误:

go get: upgrading golang.org/x/[email protected]: unrecognized import path "golang.org/x/sys" (https fetch: Get https://golang.org/x/sys?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)
go get: upgrading golang.org/x/[email protected]: unrecognized import path "golang.org/x/sys" (https fetch: Get https://golang.org/x/sys?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)

解决办法

使用七牛云 go module 镜像

golang 1.13 可以直接执行:

go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct

然后再次使用 go get 下载 gin 依赖就可以了。

发布了66 篇原创文章 · 获赞 8 · 访问量 14万+

猜你喜欢

转载自blog.csdn.net/gnufre/article/details/104183578