You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
425 B

package Application
import (
"fmt"
"github.com/Knetic/govaluate"
"testing"
)
/*
*
@author: sre
@date: 2022/8/22 0022
@desc: todo
*
*/
func TestEquel(t *testing.T) {
str := "1--2"
expr, err := govaluate.NewEvaluableExpression(str)
if err != nil {
fmt.Println("NewEvaluableExpression eror:", err)
}
result, err := expr.Evaluate(nil)
if err != nil {
fmt.Println("Evaluate error:", err)
}
fmt.Println(result)
}