英文:
go mod vendor should not have @version error
问题
升级到go v1.18.1后,go mod vendor
返回了一系列错误。在go 1.17.9中它是正常工作的。我应该怎么办?
英文:
After upgrading to go v1.18.1, go mod vendor
returns a bunch of errors:
$ go mod vendor
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/davecgh/go-spew@v1.1.1/spew: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/davecgh/go-spew@v1.1.1/spew" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/dustin/go-humanize@v1.0.0: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/dustin/go-humanize@v1.0.0" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/dustin/go-humanize@v1.0.0/english: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/dustin/go-humanize@v1.0.0/english" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/eknkc/amber@v0.0.0-20171010120322-cdade1c07385: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/eknkc/amber@v0.0.0-20171010120322-cdade1c07385" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/eknkc/amber@v0.0.0-20171010120322-cdade1c07385/amberc: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/eknkc/amber@v0.0.0-20171010120322-cdade1c07385/amberc" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/eknkc/amber@v0.0.0-20171010120322-cdade1c07385/parser: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/eknkc/amber@v0.0.0-20171010120322-cdade1c07385/parser" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/jmespath/go-jmespath@v0.0.0-20180206201540-c2b33e8439af: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/jmespath/go-jmespath@v0.0.0-20180206201540-c2b33e8439af" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/jmespath/go-jmespath@v0.0.0-20180206201540-c2b33e8439af/cmd/jpgo: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/jmespath/go-jmespath@v0.0.0-20180206201540-c2b33e8439af/cmd/jpgo" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/jmespath/go-jmespath@v0.0.0-20180206201540-c2b33e8439af/fuzz: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/jmespath/go-jmespath@v0.0.0-20180206201540-c2b33e8439af/fuzz" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/joho/godotenv@v1.3.0: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/joho/godotenv@v1.3.0" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/joho/godotenv@v1.3.0/autoload: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/joho/godotenv@v1.3.0/autoload" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/joho/godotenv@v1.3.0/cmd/godotenv: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/joho/godotenv@v1.3.0/cmd/godotenv" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/klauspost/pgzip@v1.2.5: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/klauspost/pgzip@v1.2.5" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/go-zglob@v0.0.2-0.20191112051448-a8912a37f9e7: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/go-zglob@v0.0.2-0.20191112051448-a8912a37f9e7" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/go-zglob@v0.0.2-0.20191112051448-a8912a37f9e7/cmd/zglob: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/go-zglob@v0.0.2-0.20191112051448-a8912a37f9e7/cmd/zglob" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/go-zglob@v0.0.2-0.20191112051448-a8912a37f9e7/fastwalk: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/go-zglob@v0.0.2-0.20191112051448-a8912a37f9e7/fastwalk" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/go-zglob@v0.0.3: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/go-zglob@v0.0.3" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/go-zglob@v0.0.3/cmd/zglob: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/go-zglob@v0.0.3/cmd/zglob" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/go-zglob@v0.0.3/fastwalk: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/mattn/go-zglob@v0.0.3/fastwalk" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/nfnt/resize@v0.0.0-20180221191011-83c6a9932646: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/nfnt/resize@v0.0.0-20180221191011-83c6a9932646" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/pkg/errors@v0.9.1: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/pkg/errors@v0.9.1" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/pmezard/go-difflib@v1.0.0/difflib: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/pmezard/go-difflib@v1.0.0/difflib" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/satori/go.uuid@v1.2.1-0.20181028125025-b2ce2384e17b: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/satori/go.uuid@v1.2.1-0.20181028125025-b2ce2384e17b" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/tylerb/graceful@v1.2.15: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/tylerb/graceful@v1.2.15" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/tylerb/graceful@v1.2.15/tests: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/tylerb/graceful@v1.2.15/tests" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/urfave/negroni@v1.0.0: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/github.com/urfave/negroni@v1.0.0" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/assert.v1@v1.2.1: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/assert.v1@v1.2.1" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/non-standard/validators: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/non-standard/validators" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/translations/en: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/translations/en" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/translations/fr: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/translations/fr" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/translations/id: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/translations/id" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/translations/ja: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/translations/ja" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/translations/nl: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/translations/nl" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/translations/pt_BR: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/translations/pt_BR" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/translations/zh: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/translations/zh" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/translations/zh_tw: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/go-playground/validator.v9@v9.29.1/translations/zh_tw" should not have @version
bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/unrolled/render.v1@v1.0.0: import path "bitbucket.org/jigspace/jigpipeline/lib/go/pkg/mod/gopkg.in/unrolled/render.v1@v1.0.0" should not have @version
With go 1.17.9 it worked okay. What should I do?
答案1
得分: 1
在我的情况下,在将一个旧项目升级到go 1.19
之后出现了错误。
以下是我解决问题的步骤:
- 首先,如果有的话,删除项目中的
pkg/
目录。 - 然后运行以下命令:
go clean -modcache go mod tidy
英文:
In my case, the error occur after upgrade a old project to go 1.19
.
Here is what I did to fix it:
- First delete
pkg/
dir of project, if any. - Then run cmd:
go clean -modcache go mod tidy
答案2
得分: 0
我删除了lib/go目录,现在它可以正常工作了。
英文:
I deleted lib/go directory and it works now.
答案3
得分: 0
只需在tidy命令中添加-e
以忽略错误
go mod tidy -e
英文:
Just add -e
to tidy command to ignore errors
go mod tidy -e
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论