x/tools/go/packages: clarify error invariants #28231
Labels
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
packages.Load("nonesuch") and Load("") both return a Package, presumably just as a place to hold errors. The package Name field is empty, which is a good clue that the package doesn't exist, and the Errors slice is non-empty. However, the Types field is non-nil and Complete(), which causes the gopackages diagnostic/example tool to report "has complete exported type info" for a package that doesn't exist.
The task of this issue is to clarify which fields can be relied upon in each error scenario and to improve the output and logic of the gopackages tool to reflect this.
The text was updated successfully, but these errors were encountered: