-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
ProposalProposal-AcceptedToolProposalIssues 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
Background: gopls has a couple dozen Analyzers that flag features of Go code that could be improved by using newer features of the languages and library, and that suggest fixes to do so. We would like to make this functionality available in go fix
(see #71859).
Proposal: we propose to move the x/tools/gopls/internal/modernize directory to x/tools/go/analysis/passes/modernize.
package modernize // import "golang.org/x/tools/go/passes/modernize"
// Suite lists all modernize analyzers that are safe to be enabled by default.
var Suite = []*analysis.Analyzer{
AnyAnalyzer,
// AppendClippedAnalyzer, // not nil-preserving!
BLoopAnalyzer,
FmtAppendfAnalyzer,
ForVarAnalyzer,
MapsLoopAnalyzer,
MinMaxAnalyzer,
OmitZeroAnalyzer,
RangeIntAnalyzer,
SlicesContainsAnalyzer,
// SlicesDeleteAnalyzer, // not nil-preserving!
SlicesSortAnalyzer,
StringsCutPrefixAnalyzer,
StringsSeqAnalyzer,
TestingContextAnalyzer,
WaitGroupAnalyzer,
}
var (
AnyAnalyzer,
AppendClippedAnalyzer,
BLoopAnalyzer,
FmtAppendfAnalyzer,
ForVarAnalyzer,
MapsLoopAnalyzer,
MinMaxAnalyzer,
OmitZeroAnalyzer,
RangeIntAnalyzer,
SlicesContainsAnalyzer,
SlicesDeleteAnalyzer,
SlicesSortAnalyzer,
StringsCutPrefixAnalyzer,
StringsSeqAnalyzer,
TestingContextAnalyzer,
WaitGroupAnalyzer
*analysis.Analyzer
)
atdiar, moisesvega, alexandear, ngotchac, hanzei and 2 more
Metadata
Metadata
Assignees
Labels
ProposalProposal-AcceptedToolProposalIssues 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
Accepted