-
Notifications
You must be signed in to change notification settings - Fork 18k
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
proposal: cmd/go: add way to force ignoring vendor directory #39247
Comments
have you considered setting |
The problem with It is a workaround every developer will be forced to apply which I suppose it is OK but it would be better if the |
This seems similar to #37724. Like in that issue, the simplest answer is probably to put your Go code in a subdirectory of the repo, adjacent to vendor/ instead of as a parent of it. |
@rsc Thanks for taking the time to respond, I appreciate having a clear path forward vs not knowing if this is a workflow that is planned for in the future. As you commented in the liked issue:
In the case of the vendor dir, the dummy go.mod doesn't work but putting the go.mod in a sibling dir will certainly work. I'll close this issue since this one is not reason alone to add ignore directives to the go.mod file. |
This proposal has been declined as retracted. |
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?
mkdir mod-mod && cd mod-mod
go mod init github.com/DavidGamba/mod-mod
mkdir vendor && touch vendor/hello
Common workarounds don't work.
What did you expect to see?
An option to tell go to always run in mod mode so it ignores the vendor directory used by other code in the monorepo. The option should be persisted in the
go.mod
file so there is no need to pass it to the command line every time and so other tools like gopls know about it.What did you see instead?
vendor mode is assumed wrongly due to the presence of a
vendor/
directory.The text was updated successfully, but these errors were encountered: