当前位置:首页 » 《随便一记》 » 正文

go mod tidy报错:zip: not a valid zip file

0 人参与  2024年03月03日 17:36  分类 : 《随便一记》  评论

点击全文阅读


go get报错:zip: not a valid zip file

具体报错:

User@3-WIN10BG0088 MINGW64 /d/Users/WorkSpace/Go/projects/gin-study$ go get github.com/gin-gonic/gingo: downloading github.com/gin-gonic/gin v1.9.1go: github.com/gin-gonic/gin: zip: not a valid zip fileUser@3-WIN10BG0088 MINGW64 /d/Users/WorkSpace/Go/projects/gin-study$ go env | grep PROXYset GONOPROXY=set GOPROXY=https://mirrors.aliyun.com/goproxy/,direct

解决方式:

方式1:执行 go clean -modcache清理缓存(无效)
User@3-WIN10BG0088 MINGW64 /d/Users/WorkSpace/Go/projects/gin-study$ go clean -modcacheUser@3-WIN10BG0088 MINGW64 /d/Users/WorkSpace/Go/projects/gin-study$ go mod tidygo: finding module for package github.com/gin-gonic/gingo: downloading github.com/gin-gonic/gin v1.9.1go: github.com/ice-fire-song/gin-study imports        github.com/gin-gonic/gin: zip: not a valid zip file
方式2:更换GOPROXY为七牛云的go代理(有效)
User@3-WIN10BG0088 MINGW64 /d/Users/WorkSpace/Go/projects/gin-study$ go env -w GOPROXY="https://goproxy.cn,direct"User@3-WIN10BG0088 MINGW64 /d/Users/WorkSpace/Go/projects/gin-study$ go env|grep PROXYset GONOPROXY=set GOPROXY=https://goproxy.cn,directUser@3-WIN10BG0088 MINGW64 /d/Users/WorkSpace/Go/projects/gin-study$ go mod tidygo: finding module for package github.com/gin-gonic/gingo: downloading github.com/gin-gonic/gin v1.9.1go: found github.com/gin-gonic/gin in github.com/gin-gonic/gin v1.9.1go: downloading github.com/gin-contrib/sse v0.1.0go: downloading github.com/mattn/go-isatty v0.0.19go: downloading golang.org/x/net v0.10.0go: downloading github.com/stretchr/testify v1.8.3go: downloading google.golang.org/protobuf v1.30.0go: downloading github.com/go-playground/validator/v10 v10.14.0go: downloading github.com/pelletier/go-toml/v2 v2.0.8go: downloading github.com/ugorji/go/codec v1.2.11go: downloading gopkg.in/yaml.v3 v3.0.1go: downloading github.com/bytedance/sonic v1.9.1go: downloading github.com/goccy/go-json v0.10.2go: downloading github.com/json-iterator/go v1.1.12go: downloading golang.org/x/sys v0.8.0go: downloading github.com/davecgh/go-spew v1.1.1go: downloading github.com/pmezard/go-difflib v1.0.0go: downloading github.com/gabriel-vasile/mimetype v1.4.2go: downloading github.com/go-playground/universal-translator v0.18.1go: downloading github.com/leodido/go-urn v1.2.4go: downloading golang.org/x/crypto v0.9.0go: downloading golang.org/x/text v0.9.0go: downloading github.com/go-playground/locales v0.14.1go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1ddgo: downloading github.com/modern-go/reflect2 v1.0.2go: downloading github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311go: downloading golang.org/x/arch v0.3.0go: downloading github.com/twitchyliquid64/golang-asm v0.15.1go: downloading github.com/klauspost/cpuid/v2 v2.2.4go: downloading github.com/go-playground/assert/v2 v2.2.0go: downloading github.com/google/go-cmp v0.5.5go: downloading gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405go: downloading golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543

点击全文阅读


本文链接:http://zhangshiyu.com/post/73166.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1