当前位置:   article > 正文

【简记】go: module github.com/gin-gonic/gin: Get “xxx“ dial tcp 142.251.43.17:443: i/o timeout

【简记】go: module github.com/gin-gonic/gin: Get “xxx“ dial tcp 142.251.43.17:443: i/o timeout

问题

enic-demo % go get github.com/gin-gonic/gin
go: module github.com/gin-gonic/gin: Get "https://proxy.golang.org/github.com/gin-gonic/gin/@v/list": dial tcp 142.251.43.17:443: i/o timeout
  • 1
  • 2

解决

执行如下两行

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

查看是否执行成功

go env
  • 1

测试

测试成功

enic-demo % go get github.com/gin-gonic/gin 
go: downloading github.com/json-iterator/go v1.1.9
go: downloading github.com/golang/protobuf v1.3.3
go: downloading gopkg.in/yaml.v2 v2.2.8
go: downloading golang.org/x/sys v0.0.0-20200116001909-b77594299b42
go: downloading golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
go: downloading github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421
go: downloading github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
go: added github.com/gin-contrib/sse v0.1.0
go: added github.com/gin-gonic/gin v1.7.7
go: added github.com/go-playground/locales v0.13.0
go: added github.com/go-playground/universal-translator v0.17.0
go: added github.com/go-playground/validator/v10 v10.4.1
go: added github.com/golang/protobuf v1.3.3
go: added github.com/json-iterator/go v1.1.9
go: added github.com/leodido/go-urn v1.2.0
go: added github.com/mattn/go-isatty v0.0.12
go: added github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421
go: added github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
go: added github.com/ugorji/go/codec v1.1.7
go: added golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
go: added golang.org/x/sys v0.0.0-20200116001909-b77594299b42
go: added gopkg.in/yaml.v2 v2.2.8
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/624908?site
推荐阅读
相关标签
  

闽ICP备14008679号