x/tools/go/packages: unclear how to distinguish test packages #38744
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
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?
If you set Config.Tests=true, it isn't clear how to distinguish which package is the test package and which is the normal package. For example, here are the package names and paths for the four Packages returned for the "net/http" query:
Note that 1 and 3 are identical. Since Package IDs are meant to be opaque, according to the doc, I'm at a loss for how to distinguish between these two cases. I could look for GoFiles ending in "_test.go" in each Package, but that seems hacky and requires adding NeedFiles to Config.Mode.
The text was updated successfully, but these errors were encountered: