x/tools/go/packages: can't distinguish dynamically-generated sources from checked-in ones #27909
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Refactoring
Issues related to refactoring tools
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
When using
go list -test
, we can distinguish user-provided sources from generated ones based on whether the paths are absolute, as documented here (emphasis mine):Unfortunately,
golang.org/x/tools/go/packages
removes that distinction by making all of theGoFiles
it returns absolute, without apparently preserving enough information to undo that transformation. That makes it very difficult to usego/packages
to write tools that transform or otherwise refactor user-provided source code, such as the one in CL 137076.CC @matloob @alandonovan @ianthehat @rsc
The text was updated successfully, but these errors were encountered: