x/tools/go/analysis/internal: Add an option to emit diagnostics for external packages #38177
Labels
Analysis
Issues related to static analysis (vet, x/tools/go/analysis)
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 golang/tools are you using?
Proposal
Currently the analysis driver in
golang/tools
prints diagnostics only for root packages. We can't change this behavior without changing thegolang/tools
repository or developing a driver from scratch because this behavior is written in theinternal
package.Some analyses could be more beneficial if they could emit diagnostics for dependencies because problems in dependencies can also be problems in the root packages.
So I would like to implement an option to emit diagnostics for external packages by adding an argument to
golang.org/x/tools/go/analysis/internal/checker.Run
, and adding a command-line argument togolang.org/x/tools/go/analysis/singlechecker.Run
andgolang.org/x/tools/go/analysis/multichecker.Run
.Is it OK, or are there any reasons why the option is not in the packages?
Thank you.
The text was updated successfully, but these errors were encountered: