Skip to content

Commit

Permalink
Revert "fix bug about not support more operations on string (#21)" (#28)
Browse files Browse the repository at this point in the history
This reverts commit d840a14.
  • Loading branch information
macabu committed Mar 20, 2024
1 parent 4945fde commit 2a0e5de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

7 changes: 1 addition & 6 deletions tests/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions visitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2a0e5de

Please sign in to comment.