From 40f774e32cffaa211a9caeab3026909c2a6319de Mon Sep 17 00:00:00 2001 From: Eugene Simonov Date: Sun, 26 Dec 2021 14:42:59 +0200 Subject: [PATCH] Reorder cases alphabetically --- pkg/analyzer/occurrences.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/analyzer/occurrences.go b/pkg/analyzer/occurrences.go index 89875f3..0d3793a 100644 --- a/pkg/analyzer/occurrences.go +++ b/pkg/analyzer/occurrences.go @@ -195,15 +195,6 @@ func (nom namedOccurrenceMap) addFromCondition(stmt *ast.IfStmt) { nom.addFromIdent(stmt.If, e.X) } } - case *ast.UnaryExpr: - switch e := v.X.(type) { - case *ast.Ident: - nom.addFromIdent(stmt.If, e) - case *ast.SelectorExpr: - nom.addFromIdent(stmt.If, e.X) - } - case *ast.Ident: - nom.addFromIdent(stmt.If, v) case *ast.CallExpr: for _, a := range v.Args { switch e := a.(type) { @@ -213,6 +204,15 @@ func (nom namedOccurrenceMap) addFromCondition(stmt *ast.IfStmt) { nom.addFromCallExpr(stmt.If, e) } } + case *ast.Ident: + nom.addFromIdent(stmt.If, v) + case *ast.UnaryExpr: + switch e := v.X.(type) { + case *ast.Ident: + nom.addFromIdent(stmt.If, e) + case *ast.SelectorExpr: + nom.addFromIdent(stmt.If, e.X) + } } }