Skip to content

Commit 2a0e5de

Browse files
authored
Revert "fix bug about not support more operations on string (#21)" (#28)
This reverts commit d840a14.
1 parent 4945fde commit 2a0e5de

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

.gitignore

-2
This file was deleted.

tests/main.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@ func testCase() string {
2727
case "moo":
2828
return ""
2929
}
30-
31-
test2 := "moo" + fmt.Sprintf("%d", testInt())
32-
if test2 > "foo" {
33-
test2 += "foo"
34-
}
35-
return "foo" + test2
30+
return "foo"
3631
}
3732

3833
func testInt() int {

visitor.go

+4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ func (v *treeVisitor) Visit(node ast.Node) ast.Visitor {
6262

6363
// if foo == "moo"
6464
case *ast.BinaryExpr:
65+
if t.Op != token.EQL && t.Op != token.NEQ {
66+
return v
67+
}
68+
6569
var lit *ast.BasicLit
6670
var ok bool
6771

0 commit comments

Comments
 (0)