本文介绍: go mod tidy报错:zip: not a valid zip file
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/gin
go: downloading github.com/gin-gonic/gin v1.9.1
go: github.com/gin-gonic/gin: zip: not a valid zip file
User@3-WIN10BG0088 MINGW64 /d/Users/WorkSpace/Go/projects/gin-study
$ go env | grep PROXY
set 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 -modcache
User@3-WIN10BG0088 MINGW64 /d/Users/WorkSpace/Go/projects/gin-study
$ go mod tidy
go: finding module for package github.com/gin-gonic/gin
go: downloading github.com/gin-gonic/gin v1.9.1
go: 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 PROXY
set GONOPROXY=
set GOPROXY=https://goproxy.cn,direct
User@3-WIN10BG0088 MINGW64 /d/Users/WorkSpace/Go/projects/gin-study
$ go mod tidy
go: finding module for package github.com/gin-gonic/gin
go: downloading github.com/gin-gonic/gin v1.9.1
go: found github.com/gin-gonic/gin in github.com/gin-gonic/gin v1.9.1
go: downloading github.com/gin-contrib/sse v0.1.0
go: downloading github.com/mattn/go-isatty v0.0.19
go: downloading golang.org/x/net v0.10.0
go: downloading github.com/stretchr/testify v1.8.3
go: downloading google.golang.org/protobuf v1.30.0
go: downloading github.com/go-playground/validator/v10 v10.14.0
go: downloading github.com/pelletier/go-toml/v2 v2.0.8
go: downloading github.com/ugorji/go/codec v1.2.11
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/bytedance/sonic v1.9.1
go: downloading github.com/goccy/go-json v0.10.2
go: downloading github.com/json-iterator/go v1.1.12
go: downloading golang.org/x/sys v0.8.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/gabriel-vasile/mimetype v1.4.2
go: downloading github.com/go-playground/universal-translator v0.18.1
go: downloading github.com/leodido/go-urn v1.2.4
go: downloading golang.org/x/crypto v0.9.0
go: downloading golang.org/x/text v0.9.0
go: downloading github.com/go-playground/locales v0.14.1
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/modern-go/reflect2 v1.0.2
go: downloading github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311
go: downloading golang.org/x/arch v0.3.0
go: downloading github.com/twitchyliquid64/golang-asm v0.15.1
go: downloading github.com/klauspost/cpuid/v2 v2.2.4
go: downloading github.com/go-playground/assert/v2 v2.2.0
go: downloading github.com/google/go-cmp v0.5.5
go: downloading gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
go: downloading golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
原文地址:https://blog.csdn.net/weixin_42492572/article/details/134380385
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_51173.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。