mirror of
https://github.com/Crocmagnon/fatcontext.git
synced 2024-11-22 07:58:05 +01:00
refactor: use multi case
This commit is contained in:
parent
71bde6a5f6
commit
89a1841d57
1 changed files with 1 additions and 3 deletions
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue