PaesslerAG / gval

Expression evaluation in golang
BSD 3-Clause "New" or "Revised" License
713 stars 83 forks source link

evaluate with operator in value not expected #94

Closed cposture closed 1 year ago

cposture commented 1 year ago

that is code:

package main

import (
    "fmt"

    "github.com/PaesslerAG/gval"
)

func main() {

    value, err := gval.Evaluate(`foo in [100, 101]`, map[string]interface{}{
        "foo": 100,
    })
    if err != nil {
        fmt.Println(err)
    }

    fmt.Print(value)

}

it expect be true, but get false

generikvault commented 1 year ago

gval uses float64 and "foo": 100 is an int