I would like to be able to eval an expr like this: EnumVal == Enum1 where I've defined ConstVal to be a standard Go const enum type:
//go:generate stringer -type=MyEnums
type MyEnums int
const (
Enum1 MyEnums = iota
Enum2
)
type MyStruct struct {
EnumVal MyEnums
}
var stru MyStruct
ev := expr.Eval(`EnumVal==Enum1`, stru)
so the string values are available and could be tested against.
Any chance of adding this?