-
-
Notifications
You must be signed in to change notification settings - Fork 377
/
analysis.go
152 lines (150 loc) · 4.31 KB
/
analysis.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
package simple
import (
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
"honnef.co/go/tools/analysis/facts"
"honnef.co/go/tools/analysis/lint"
"honnef.co/go/tools/internal/passes/buildir"
)
var Analyzers = lint.InitializeAnalyzers(Docs, map[string]*analysis.Analyzer{
"S1000": {
Run: CheckSingleCaseSelect,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1001": {
Run: CheckLoopCopy,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1002": {
Run: CheckIfBoolCmp,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1003": {
Run: CheckStringsContains,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1004": {
Run: CheckBytesCompare,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1005": {
Run: CheckUnnecessaryBlank,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1006": {
Run: CheckForTrue,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1007": {
Run: CheckRegexpRaw,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1008": {
Run: CheckIfReturn,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1009": {
Run: CheckRedundantNilCheckWithLen,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1010": {
Run: CheckSlicing,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1011": {
Run: CheckLoopAppend,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1012": {
Run: CheckTimeSince,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1016": {
Run: CheckSimplerStructConversion,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1017": {
Run: CheckTrim,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1018": {
Run: CheckLoopSlide,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1019": {
Run: CheckMakeLenCap,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1020": {
Run: CheckAssertNotNil,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1021": {
Run: CheckDeclareAssign,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1023": {
Run: CheckRedundantBreak,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1024": {
Run: CheckTimeUntil,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1025": {
Run: CheckRedundantSprintf,
Requires: []*analysis.Analyzer{buildir.Analyzer, inspect.Analyzer, facts.Generated},
},
"S1028": {
Run: CheckErrorsNewSprintf,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1029": {
Run: CheckRangeStringRunes,
Requires: []*analysis.Analyzer{buildir.Analyzer},
},
"S1030": {
Run: CheckBytesBufferConversions,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1031": {
Run: CheckNilCheckAroundRange,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1032": {
Run: CheckSortHelpers,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1033": {
Run: CheckGuardedDelete,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1034": {
Run: CheckSimplifyTypeSwitch,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1035": {
Run: CheckRedundantCanonicalHeaderKey,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1036": {
Run: CheckUnnecessaryGuard,
Requires: []*analysis.Analyzer{inspect.Analyzer},
},
"S1037": {
Run: CheckElaborateSleep,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1038": {
Run: CheckPrintSprintf,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1039": {
Run: CheckSprintLiteral,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1040": {
Run: CheckSameTypeTypeAssertion,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
})