Proposal Details
When developing a custom analyzer for a project, it feels most natural to add that analyzer to the existing default analyzers, rather than run the two sets of analyzers in separate invocations.
However, cmd/vet/main.go currently contains the list of default analyzers for go vet, but does not provide a programmatic way to access this information.
In this proposal, the list of analyzers would be available in some global variable (or function) in cmd/vet or x/tools/analysis/all or some other suitable location. Something like
var Analyzers = []analysis.Analyzer {
appends.Analyzer,
asmdecl.Analyzer,
assign.Analyzer,
atomic.Analyzer,
...
}
then a custom analyzer could use something like
var analyzers = []analysis.Analyzer {
MyAnalyzer,
MyOtherAnalyzer,
}
analyzers = append(analyzers, all.Analyzers...)
multichecker.Main(analyzers...)
Proposal Details
When developing a custom analyzer for a project, it feels most natural to add that analyzer to the existing default analyzers, rather than run the two sets of analyzers in separate invocations.
However, cmd/vet/main.go currently contains the list of default analyzers for
go vet, but does not provide a programmatic way to access this information.In this proposal, the list of analyzers would be available in some global variable (or function) in
cmd/vetorx/tools/analysis/allor some other suitable location. Something likethen a custom analyzer could use something like