forked from golangci/golangci-lint
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunlen.go
188 lines (185 loc) · 2.39 KB
/
funlen.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
//golangcitest:args -Efunlen
package testdata
func TooManyLines() { // want `Function 'TooManyLines' is too long \(70 > 60\)`
t := struct {
A0 string
A1 string
A2 string
A3 string
A4 string
A5 string
A6 string
A7 string
A8 string
A9 string
A10 string
A11 string
A12 string
A13 string
A14 string
A15 string
A16 string
A17 string
A18 string
A19 string
A20 string
A21 string
A22 string
A23 string
A24 string
A25 string
A26 string
A27 string
A28 string
A29 string
A30 string
A31 string
A32 string
}{
A0: "a",
A1: "a",
A2: "a",
A3: "a",
A4: "a",
A5: "a",
A6: "a",
A7: "a",
A8: "a",
A9: "a",
A10: "a",
A11: "a",
A12: "a",
A13: "a",
A14: "a",
A15: "a",
A16: "a",
A17: "a",
A18: "a",
A19: "a",
A20: "a",
A21: "a",
A22: "a",
A23: "a",
A24: "a",
A25: "a",
A26: "a",
A27: "a",
A28: "a",
A29: "a",
A30: "a",
A31: "a",
A32: "a",
}
_ = t
}
func TooManyStatements() { // want `Function 'TooManyStatements' has too many statements \(46 > 40\)`
a0 := 1
a1 := 1
a2 := 1
a3 := 1
a4 := 1
a5 := 1
a6 := 1
a7 := 1
a8 := 1
a9 := 1
a10 := 1
a11 := 1
a12 := 1
a13 := 1
a14 := 1
a15 := 1
a16 := 1
a17 := 1
a18 := 1
a19 := 1
a20 := 1
a21 := 1
a22 := 1
_ = a0
_ = a1
_ = a2
_ = a3
_ = a4
_ = a5
_ = a6
_ = a7
_ = a8
_ = a9
_ = a10
_ = a11
_ = a12
_ = a13
_ = a14
_ = a15
_ = a16
_ = a17
_ = a18
_ = a19
_ = a20
_ = a21
_ = a22
}
func withComments() {
// Comment 1
// Comment 2
// Comment 3
// Comment 4
// Comment 5
// Comment 6
// Comment 7
// Comment 8
// Comment 9
// Comment 10
// Comment 11
// Comment 12
// Comment 13
// Comment 14
// Comment 15
// Comment 16
// Comment 17
// Comment 18
// Comment 19
// Comment 20
// Comment 21
// Comment 22
// Comment 23
// Comment 24
// Comment 25
// Comment 26
// Comment 27
// Comment 28
// Comment 29
// Comment 30
// Comment 31
// Comment 32
// Comment 33
// Comment 34
// Comment 35
// Comment 36
// Comment 37
// Comment 38
// Comment 39
// Comment 40
// Comment 41
// Comment 42
// Comment 43
// Comment 44
// Comment 45
// Comment 46
// Comment 47
// Comment 48
// Comment 49
// Comment 50
// Comment 51
// Comment 52
// Comment 53
// Comment 54
// Comment 55
// Comment 56
// Comment 57
// Comment 58
// Comment 59
// Comment 60
print("Hello, world!")
}