-
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: improve error when a package exists in the filesystem but is in a different module #30590
Comments
It appears that |
So by creating nested modules, you exclude the resulting files from the main module scope. |
We should fix the error message, at least. Pretty sure this is a duplicate. |
#27957 is related, but doesn't mention fixing the error message explicitly. |
CC @jayconrod |
I fully understand that "nested modules" are excluded from the "parent module". I have no issue with that. The issues I do have are:
Sure, fine, that's reasonable and makes sense. But
I don't understand the logic behind that last step. When I run |
Change https://golang.org/cl/185345 mentions this issue: |
Change https://golang.org/cl/185417 mentions this issue: |
This change is a non-minimal fix for #32917, but incidentally fixes several other bugs and makes the error messages much more ergonomic. Updates #32917 Updates #27122 Updates #28459 Updates #29280 Updates #30590 Updates #37214 Updates #36173 Updates #36587 Fixes #36008 Fixes #30992 Change-Id: Iedb26d2e0963697c130df5d0f72e7f83ec2dcf06 Reviewed-on: https://go-review.googlesource.com/c/go/+/185345 Reviewed-by: Michael Matloob <[email protected]> Reviewed-by: Jay Conrod <[email protected]>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes (1.12)
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
go build ./a (cd ./a && go build)
What did you expect to see?
I expect
go build ./a
from the project root andgo build
from the submodulea
to behave the same.What did you see instead?
Adding
a/go.mod
causesgo build ./a
andcd ./a; go build
to behave differently.The text was updated successfully, but these errors were encountered: