-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Labels
ProposalToolProposalIssues describing a requested change to a Go tool or command-line program.Issues describing a requested change to a Go tool or command-line program.
Milestone
Description
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...)
Metadata
Metadata
Assignees
Labels
ProposalToolProposalIssues describing a requested change to a Go tool or command-line program.Issues describing a requested change to a Go tool or command-line program.
Type
Projects
Status
No status