登录
首页 >  Golang >  Go问答

go mod供应商不应该有@version错误

来源:stackoverflow

时间:2024-03-17 17:00:23 155浏览 收藏

Go 1.18.1 中,`go mod vendor` 命令会因供应商路径包含 `@version` 而引发错误。这些路径源自已从模块中删除的依赖项,导致供应商中存在不正确的版本信息。要解决此问题,建议删除 `lib/go` 目录并重新运行 `go mod vendor` 命令。

问题内容

升级到go v1.18.1后,go modvendor返回一堆错误:

$ go mod vendor
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/davecgh/[email protected]/spew: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/davecgh/[email protected]/spew" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/dustin/[email protected]: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/dustin/[email protected]" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/dustin/[email protected]/english: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/dustin/[email protected]/english" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/eknkc/[email protected]: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/eknkc/[email protected]" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/eknkc/[email protected]/amberc: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/eknkc/[email protected]/amberc" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/eknkc/[email protected]/parser: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/eknkc/[email protected]/parser" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/jmespath/[email protected]: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/jmespath/[email protected]" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/jmespath/[email protected]/cmd/jpgo: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/jmespath/[email protected]/cmd/jpgo" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/jmespath/[email protected]/fuzz: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/jmespath/[email protected]/fuzz" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/joho/[email protected]: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/joho/[email protected]" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/joho/[email protected]/autoload: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/joho/[email protected]/autoload" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/joho/[email protected]/cmd/godotenv: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/joho/[email protected]/cmd/godotenv" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/klauspost/[email protected]: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/klauspost/[email protected]" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/[email protected]: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/[email protected]" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/[email protected]/cmd/zglob: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/[email protected]/cmd/zglob" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/[email protected]/fastwalk: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/[email protected]/fastwalk" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/[email protected]: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/[email protected]" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/[email protected]/cmd/zglob: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/[email protected]/cmd/zglob" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/[email protected]/fastwalk: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/[email protected]/fastwalk" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/nfnt/[email protected]: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/nfnt/[email protected]" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/pkg/[email protected]: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/pkg/[email protected]" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/pmezard/[email protected]/difflib: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/pmezard/[email protected]/difflib" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/satori/[email protected]: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/satori/[email protected]" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/tylerb/[email protected]: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/tylerb/[email protected]" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/tylerb/[email protected]/tests: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/tylerb/[email protected]/tests" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/urfave/[email protected]: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/urfave/[email protected]" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/non-standard/validators: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/non-standard/validators" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/translations/en: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/translations/en" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/translations/fr: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/translations/fr" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/translations/id: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/translations/id" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/translations/ja: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/translations/ja" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/translations/nl: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/translations/nl" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/translations/pt_BR: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/translations/pt_BR" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/translations/zh: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/translations/zh" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/translations/zh_tw: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/[email protected]/translations/zh_tw" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/unrolled/[email protected]: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/unrolled/[email protected]" should not have @version

使用 go 1.17.9 一切正常。我该怎么办?


正确答案


我删除了 lib/go 目录,现在它可以工作了。

今天关于《go mod供应商不应该有@version错误》的内容就介绍到这里了,是不是学起来一目了然!想要了解更多关于的内容请关注golang学习网公众号!

声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>