go-jmespath
go-jmespath copied to clipboard
can get the result If the expression is to determine that the Numbers are equal
func Test(t *testing.T) {
user := struct {
ID int
Name string
}{
ID:1,
Name:"a",
}
users := []interface{}{user}
res, _ := jmespath.Search("[?ID=='1']", users)
fmt.Println(res)
}
=== RUN Test [] --- PASS: Test (0.00s) PASS