-
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: Go toolchain ./... commands don't work with a combination of sub-modules and go.work file #59610
Comments
cc @bcmills |
Is this related to #59480? |
No I don't believe so. Here, you are entering that submodule and doing |
So in
I believe workspace has higher priority than the module, which is why it reports the main module to be the one rooted in the workspace directory ( |
Yes, there is a difference between I need to check if adding |
Aha! That fixed it. Sorry for the noise. No bug here. But rather a slightly misleading error perhaps. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
This repro needs two repos for it to happen.
go list ./...
and observe everything work fine.cd public
from there, and repeatgo list ./...
Error thrown:
pattern ./...: main module (github.com/agnivade/modbug/v7) does not contain package github.com/agnivade/modbug/v7/public/model
Same error with
go test ./...
as wellObservations
go test github.com/agnivade/modbug/public/v7/...
works fine from inside public directory.Notes
go mod tidy
under modbug. You need to remove the import.go file before that. The expected state of the codebase is to rungo mod tidy
after removing import.go file. But the import.go file should remain nevertheless. (Yes I know it's weird. It's complicated to explain :P)The text was updated successfully, but these errors were encountered: