Go

Go1.13 下载依赖超时

March 3, 2020

go mod tidy 整理依赖时出现 github 第三方依赖io连接超时:

1
2
3
4
5
6
7
8
~/backend/ginframe > go mod tidy
go: downloading github.com/stretchr/testify v1.4.0
go: downloading gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
go: downloading gopkg.in/go-playground/assert.v1 v1.2.1
gintest imports
	github.com/gin-gonic/gin tested by
	github.com/gin-gonic/gin.test imports
	github.com/stretchr/testify/assert: github.com/stretchr/testify@v1.4.0: Get https://proxy.golang.org/github.com/stretchr/testify/@v/v1.4.0.zip: dial tcp 172.217.24.17:443: i/o timeout

指定七牛云作为 go module 的镜像代理,也可以选择其他镜像源,继续下载依赖即可

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