cmd/go: for package loading errors, decide when to show source position or import stack #43696
Labels
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
In
cmd/go/internal/load.PackageError.Error
, we have some complicated logic that decides whether we print a source position or an import stack with an error. Currently, we print the source position if it's available (with one exception for importing an internal package from a place that's not allowed). If the source position isn't available, we print the import stack.For deeply imported packages, especially those in other modules, the source position isn't necessarily more useful than the import stack. The user may have no knowledge of an indirect dependency that can't be loaded in their specific configuration. We may also want to print the source position together with the import stack.
We should document whatever we decide, even if we don't change anything to avoid confusion in the future.
This shouldn't affect the output of
go list -json
orgo list -f
.cc @bcmills @matloob
The text was updated successfully, but these errors were encountered: