Debian Codegraph @

go/analysis/suite/fix/fix.go

raw symbols SCIP
1 // Copyright 2026 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // The fix package defines the suite of analyzers used by cmd/fix,
6 // the default analysis tool run by "go fix".
7 // Its behavior is equivalent to:
8 //
9 // func main() { unitchecker.Main(fix.Suite...) }
10 //
11 // If you need a different suite, define your own tool
12 // and run "go vet -vettool=mytool".
13 package fixscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/suite/fix`/
14
15 import (
16 "slicesscip-go gomod github.com/golang/go/src go1.25.0 slices/"
17
18 "golang.org/x/tools/go/analysisscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis`/"
19 "golang.org/x/tools/go/analysis/passes/buildtagscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/buildtag`/"
20 "golang.org/x/tools/go/analysis/passes/hostportscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/hostport`/"
21 "golang.org/x/tools/go/analysis/passes/inlinescip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/inline`/"
22 "golang.org/x/tools/go/analysis/passes/modernizescip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/modernize`/"
23 )
24
25 // Suite is the suite of analyzers run by cmd/fix.
26 //
27 // The fix suite analyzers produce fixes are unambiguously safe to apply,
28 // even if the diagnostics might not describe actual problems.
29 var Suitescip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/suite/fix`/Suite. = slicesscip-go gomod github.com/golang/go/src go1.25.0 slices/.Concatscip-go gomod github.com/golang/go/src go1.25.0 slices/Concat().(
30 []*analysisscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis`/.Analyzerscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis`/Analyzer#{
31 buildtagscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/buildtag`/.Analyzerscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/buildtag`/Analyzer.,
32 hostportscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/hostport`/.Analyzerscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/hostport`/Analyzer.,
33 inlinescip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/inline`/.Analyzerscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/inline`/Analyzer.,
34 },
35 modernizescip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/modernize`/.Suitescip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/modernize`/Suite.,
36 // TODO(adonovan): add any other vet analyzers whose fixes are always safe.
37 // Candidates to audit: sigchanyzer, printf, assign, unreachable.
38 // Many of staticcheck's analyzers would make good candidates
39 // (e.g. rewriting WriteString(fmt.Sprintf()) to Fprintf.)
40 // Rejected:
41 // - composites: some types (e.g. PointXY{1,2}) don't want field names.
42 // - timeformat: flipping MM/DD is a behavior change, but the code
43 // could potentially be a workaround for another bug.
44 // - stringintconv: offers two fixes, user input required to choose.
45 // - fieldalignment: poor signal/noise; fix could be a regression.
46 )