原始go.mod文件

module xxx

go 1.14

报错 i/o timeout

go mod init workorder
go mod init: go.mod already exists

go mod tidy
go: finding module for package github.com/greyh4t/zhttp
go: finding module for package github.com/tidwall/gjson
go: finding module for package github.com/deckarep/golang-set
workorder imports
        github.com/deckarep/golang-set: module github.com/deckarep/golang-set: Get "https://proxy.golang.org/github.com/deckarep/golang-set/@v/list": dial tcp 34.64.4.81:443: i/o timeout
workorder imports
        github.com/greyh4t/zhttp: module github.com/greyh4t/zhttp: Get "https://proxy.golang.org/github.com/greyh4t/zhttp/@v/list": dial tcp 34.64.4.81:443: i/o timeout
workorder imports
        github.com/tidwall/gjson: module github.com/tidwall/gjson: Get "https://proxy.golang.org/github.com/tidwall/gjson/@v/list": dial tcp 34.64.4.81:443: i/o timeout

加代理

➜  ~ vim ./.zshrc

export GO111MODULE=on
export GOPROXY=https://goproxy.io

➜  ~ . ./.zshrc

然后在运行一次:go mod tidy

加载后的go.mod文件

module xxx

go 1.14

require (
	github.com/deckarep/golang-set v1.7.1
	github.com/greyh4t/zhttp v0.0.0-20200602035456-2186ce915b30
	github.com/stretchr/testify v1.6.1 // indirect
	github.com/tidwall/gjson v1.6.0
)

参考

https://blog.csdn.net/dgatiger/article/details/105205190
https://blog.csdn.net/zzhongcy/article/details/97243826

内容来源于网络如有侵权请私信删除

文章来源: 博客园

原文链接: https://www.cnblogs.com/mysticbinary/p/13094937.html

你还没有登录,请先登录注册
  • 还没有人评论,欢迎说说您的想法!

相关课程