golang / dep

Go dependency management tool experiment (deprecated)
https://golang.github.io/dep/
BSD 3-Clause "New" or "Revised" License
12.86k stars 1.05k forks source link

Dep ensure contains malformed code for version module #2154

Closed jinlianch closed 3 years ago

jinlianch commented 5 years ago

What version of dep are you using (dep version)?

dep: version : devel build date : git hash : go version : go1.12.3 go compiler : gc platform : darwin/amd64 features : ImportDuringSolve=false

git describe --tags: v0.5.1-3-g66ec1e8

What dep command did you run?

dep ensure -add github.com/elastic/go-elasticsearch@v7.0.0

What did you expect to see?

Install go-elasticsearch of 7.0.0 version successfully. If I use command dep ensure -add github.com/elastic/go-elasticsearch, it will get github.com/elastic/go-elasticsearch@v0.0.0, not the latest release.

What did you see instead?

Fetching sources...

Solving failure: No versions of github.com/elastic/go-elasticsearch met constraints: v0.0.0: Could not introduce github.com/elastic/go-elasticsearch@v0.0.0, as it is not allowed by constraint ^7.0.0 from project Rigel/go. v7.0.0: "github.com/elastic/go-elasticsearch" imports "github.com/elastic/go-elasticsearch/v7/esapi", which contains malformed code: unknown error for "github.com/elastic/go-elasticsearch/v7/esapi", if you get this error see https://github.com/golang/dep/issues/351 v6.7.0: Could not introduce github.com/elastic/go-elasticsearch@v6.7.0, as it is not allowed by constraint ^7.0.0 from project Rigel/go. v5.6.0: Could not introduce github.com/elastic/go-elasticsearch@v5.6.0, as it is not allowed by constraint ^7.0.0 from project Rigel/go. v7.0.0-rc1: Could not introduce github.com/elastic/go-elasticsearch@v7.0.0-rc1, as it is not allowed by constraint ^7.0.0 from project Rigel/go. master: Could not introduce github.com/elastic/go-elasticsearch@master, as it is not allowed by constraint ^7.0.0 from project Rigel/go. 5.x: Could not introduce github.com/elastic/go-elasticsearch@5.x, as it is not allowed by constraint ^7.0.0 from project Rigel/go. 6.x: Could not introduce github.com/elastic/go-elasticsearch@6.x, as it is not allowed by constraint ^7.0.0 from project Rigel/go. 7.x: Could not introduce github.com/elastic/go-elasticsearch@7.x, as it is not allowed by constraint ^7.0.0 from project Rigel/go. old: Could not introduce github.com/elastic/go-elasticsearch@old, as it is not allowed by constraint ^7.0.0 from project Rigel/go. travis: Could not introduce github.com/elastic/go-elasticsearch@travis, as it is not allowed by constraint ^7.0.0 from project Rigel/go. xpack: Could not introduce github.com/elastic/go-elasticsearch@xpack, as it is not allowed by constraint ^7.0.0 from project Rigel/go.

Seems it's caused by the package use go module to generate a specify module name, so it can't import the package. It's there a way to fix this?

kevinburke commented 5 years ago

I think #1963 will address this, I may have time to review that PR today (to see if it answers your question first, as well).

AlekSi commented 5 years ago

@kevinburke That would be really nice! 🙏

mvdan commented 3 years ago

Dep was officially deprecated earlier this year, and the proposal to archive this repository was accepted. As such, I'm closing outstanding issues before archiving the repository. For any further comments, please use the proposal thread on the Go issue tracker. Thanks!