cmd/go: Go toolchain ./... commands don't work with a combination of sub-modules and go.work file #59610
Labels
GoCommand
cmd/go
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
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: