diff --git a/.gitignore b/.gitignore deleted file mode 100644 index a9d34d9..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.idea -goconst \ No newline at end of file diff --git a/tests/main.go b/tests/main.go index 3e28292..d43e983 100644 --- a/tests/main.go +++ b/tests/main.go @@ -27,12 +27,7 @@ func testCase() string { case "moo": return "" } - - test2 := "moo" + fmt.Sprintf("%d", testInt()) - if test2 > "foo" { - test2 += "foo" - } - return "foo" + test2 + return "foo" } func testInt() int { diff --git a/visitor.go b/visitor.go index a553814..c0974da 100644 --- a/visitor.go +++ b/visitor.go @@ -62,6 +62,10 @@ func (v *treeVisitor) Visit(node ast.Node) ast.Visitor { // if foo == "moo" case *ast.BinaryExpr: + if t.Op != token.EQL && t.Op != token.NEQ { + return v + } + var lit *ast.BasicLit var ok bool