From 89a1841d57fbde3a1332114d16b6f8622d8ba2ce Mon Sep 17 00:00:00 2001 From: Venkatesh Kotwade Date: Mon, 26 Aug 2024 01:29:37 +0530 Subject: [PATCH] refactor: use multi case --- pkg/analyzer/analyzer.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/analyzer/analyzer.go b/pkg/analyzer/analyzer.go index 677c097..611f303 100644 --- a/pkg/analyzer/analyzer.go +++ b/pkg/analyzer/analyzer.go @@ -78,9 +78,7 @@ func run(pass *analysis.Pass) (interface{}, error) { func getReportMessage(node ast.Node) string { switch node.(type) { - case *ast.ForStmt: - return "nested context in loop" - case *ast.RangeStmt: + case *ast.ForStmt, *ast.RangeStmt: return "nested context in loop" case *ast.FuncLit: return "nested context in function literal"