Skip to content

Commit 725e4d9

Browse files
committed
refactor: use checkStmts and checkExprs
1 parent f08212c commit 725e4d9

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

usetesting.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,7 @@ func (a *analyzer) checkExpr(pass *analysis.Pass, fnInfo FuncInfo, exp ast.Expr)
244244
a.reportSelector(pass, expr, fnInfo)
245245

246246
case *ast.FuncLit:
247-
for _, stmt := range expr.Body.List {
248-
a.checkStmt(pass, fnInfo, stmt)
249-
}
247+
checkStmts(a, pass, fnInfo, expr.Body.List)
250248

251249
case *ast.TypeAssertExpr:
252250
a.checkExpr(pass, fnInfo, expr.X)
@@ -256,10 +254,7 @@ func (a *analyzer) checkExpr(pass *analysis.Pass, fnInfo FuncInfo, exp ast.Expr)
256254
return
257255
}
258256

259-
for _, arg := range expr.Args {
260-
a.checkExpr(pass, fnInfo, arg)
261-
}
262-
257+
checkExprs(a, pass, fnInfo, expr.Args)
263258
a.checkExpr(pass, fnInfo, expr.Fun)
264259

265260
case *ast.Ident:

0 commit comments

Comments
 (0)