File tree 1 file changed +4
-17
lines changed
1 file changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -256,35 +256,22 @@ func run(pass *analysis.Pass) (interface{}, error) {
256
256
}
257
257
258
258
for _ , expr := range caseClause .List {
259
- binaryExpr , ok := expr .(* ast.BinaryExpr )
259
+ e , ok := expr .(* ast.BinaryExpr )
260
260
if ! ok {
261
261
continue
262
262
}
263
263
264
- selectorExpr , ok := binaryExpr .X .(* ast.SelectorExpr )
264
+ x , ok := e .X .(* ast.SelectorExpr )
265
265
if ! ok {
266
266
continue
267
267
}
268
268
269
- basicLit , ok := binaryExpr .Y .(* ast.BasicLit )
269
+ y , ok := e .Y .(* ast.BasicLit )
270
270
if ! ok {
271
271
continue
272
272
}
273
273
274
- switch selectorExpr .Sel .Name {
275
- case "StatusCode" :
276
- if ! lookupFlag (pass , HTTPStatusCodeFlag ) {
277
- continue
278
- }
279
-
280
- checkHTTPStatusCode (pass , basicLit )
281
- case "Method" :
282
- if ! lookupFlag (pass , HTTPMethodFlag ) {
283
- continue
284
- }
285
-
286
- checkHTTPMethod (pass , basicLit )
287
- }
274
+ ifstmt (pass , x , y )
288
275
}
289
276
}
290
277
}
You can’t perform that action at this time.
0 commit comments