Open
Description
please run the example code below:
package main
import (
"fmt"
"github.com/expr-lang/expr"
)
func main() {
env := map[string]any{}
tests := []struct{ code string }{
{`key == "str"`}, // ok
{`key >= "str"`}, // invalid operation: <nil> >= string
{`key > "str"`}, // invalid operation: <nil> > string
{`key <= "str"`}, // invalid operation: <nil> <= string
{`key < "str"`}, // invalid operation: <nil> < string
}
for _, tt := range tests {
program, _ := expr.Compile(tt.code)
output, err := expr.Run(program, env)
fmt.Println(output, err)
}
}
can Expr
support >
、>=
、<
、<=
like ==
operator? tks~