Open yaduomo-1990 opened 1 year ago
like this:
expr4, err := govaluate.NewEvaluableExpression("dept_id in (dept_arr)") assert.Nil(t, err) parameters = make(map[string]interface{}) parameters["dept_id"] = 20 arr := make([]int, 3) arr[0] = 10 arr[1] = 20 arr[2] = 30 parameters["dept_arr"] = arr // or------------------------------- parameters["dept_arr"] = []int{10,20} result, err = expr4.Evaluate(parameters) assert.Nil(t, err) fmt.Println("----------------") fmt.Println(result)
like this: