refactor: use multi case

This commit is contained in:
Venkatesh Kotwade 2024-08-26 01:29:37 +05:30
parent 71bde6a5f6
commit 89a1841d57

View file

@ -78,9 +78,7 @@ func run(pass *analysis.Pass) (interface{}, error) {
func getReportMessage(node ast.Node) string { func getReportMessage(node ast.Node) string {
switch node.(type) { switch node.(type) {
case *ast.ForStmt: case *ast.ForStmt, *ast.RangeStmt:
return "nested context in loop"
case *ast.RangeStmt:
return "nested context in loop" return "nested context in loop"
case *ast.FuncLit: case *ast.FuncLit:
return "nested context in function literal" return "nested context in function literal"