-
Notifications
You must be signed in to change notification settings - Fork 17.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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). |
@bcmills Thanks for your responses. The main issue I'm running into with my use-case is where I have local dependencies. Currently, the way that I'm import local dependency is via using However, this does not work with vendoring, because vendoring would copy |
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: