-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: the existence of a vendor directory kicks Go into vendor mode when using modules #38644
Comments
This was an intentional decision: a user may already have a (See specifically #33848 (comment).) |
@bcmills how would you obtain that evidence? Our polyglot repo, for instance, is not open-source. One thing of note: this worked fine until we added |
@ydnar, reports from users, statistical distributions of I would expect open-source libraries to have existing Go |
In theory it could, but we shouldn't make that change unless we are confident that it is a net-positive. Setting |
That would mean updating every CI workflow, every makefile, documentation, educating every developer, and retraining our muscle memory to add additional flags to every
Re-reading this it seems like a missed opportunity to add a |
That specifically would not have helped with issues like #37738, in which the user has forgotten about the stale Based on the user feedback we received prior to Go 1.14, I still believe that those cases are vastly more common than the one you are describing (a |
One more try: how about |
Run |
That’s fine for per user defaults, but not per repo. I mean, if the |
Using Go 1.14, this has bit us a couple times. We have a polyglot monorepo with a
go.mod
andgo.sum
file at the root level, and previously had avendor
directory for non-Go code. We’ve hacked around the issue my moving what we could out of thevendor
directory.Currently, the mere existence of a
vendor
directory as a sibling ofgo.mod
will break all Go commands unless explicitly run with-mod=mod
.Request
Go could better exist in a polyglot environment if the trigger for vendor mode was was the existence of
vendor/modules.txt
instead of just thevendor
directory.Repro Steps
The text was updated successfully, but these errors were encountered: