cmd/go: allow 'go mod vendor' to omit replaced modules #33789
Comments
At the moment, this is working as designed: Omitting same-repo dependencies is one of the use-cases I had in mind for partial vendoring (#30240). |
@bcmills Any plans for partial vendoring ? |
This issue is milestoned to |
@bcmills is this something ya'll plan to work on? Is it something we can contribute a PR for? This is a sharp edge that burdens us daily. |
@shoenig, we don't have any specific plans to work on this. If this feature is important to you, some more detail on your use-case (especially the alternatives you considered and the problems with those alternatives) would be helpful. At the moment, the big question is whether the added convenience is worth the added complexity (of both the implementation and the documentation). |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
git clone https://github.com/hashicorp/consul
go mod vendor
What did you expect to see?
I didn't expect vendor/modules.txt to contain the nested modules within it nor having those nested modules be vendored into the top level vendor folder.
What did you see instead?
Nested submodules are vendored.
We currently get around this by postprocessing the modules.txt and the vendor directory. I realize that nested modules might not be a great idea (it has caused me a number of headaches) however for code living in the same repo the current
go mod vendor
behavior of vendoring our own code doesn't make much sense to me. Is this intended behavior or just something that isn't protected against.The text was updated successfully, but these errors were encountered: