-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/go/packages: returns package with no sources in a directory that only contains a test #36292
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
Comments
/cc @bcmills @jayconrod |
It seems like this is working as intended on the I'm not sure it makes sense for |
From the perspective of For example, if module |
That makes sense - it does sound like a |
My philosophy is that go/packages should depart as little as possible, so my preference is that we consider this intended behavior. To me it seems like |
Thinking about this more, I agree that this is working as intended. This behavior actually allows us to create correct test variants for packages that only have overlays. |
If you have a directory that only contains a test variant of a package,
go list
still returns a package for the non-test variant. This ends up being a bit misleading, since the package actually has no sources. We can, of course, ignore packages that have no sources ingopls
, but I was still surprised to see this behavior.To reproduce:
The text was updated successfully, but these errors were encountered: