mirror of
https://github.com/hanzoai/expr.git
synced 2026-09-24 16:58:58 +00:00
Small fixes
This commit is contained in:
@@ -8,6 +8,7 @@ var (
|
||||
anyType = reflect.TypeOf(new(interface{})).Elem()
|
||||
integerType = reflect.TypeOf(0)
|
||||
floatType = reflect.TypeOf(float64(0))
|
||||
arrayType = reflect.TypeOf([]interface{}{})
|
||||
)
|
||||
|
||||
func kind(t reflect.Type) reflect.Kind {
|
||||
|
||||
@@ -20,7 +20,6 @@ var (
|
||||
timeType = reflect.TypeOf(time.Time{})
|
||||
durationType = reflect.TypeOf(time.Duration(0))
|
||||
functionType = reflect.TypeOf(new(func(...interface{}) (interface{}, error))).Elem()
|
||||
errorType = reflect.TypeOf((*error)(nil)).Elem()
|
||||
)
|
||||
|
||||
func combined(a, b reflect.Type) reflect.Type {
|
||||
|
||||
@@ -32,6 +32,7 @@ type Env struct {
|
||||
Abstract Abstract
|
||||
ArrayOfAny []interface{}
|
||||
ArrayOfInt []int
|
||||
ArrayOfString []string
|
||||
ArrayOfFoo []*Foo
|
||||
MapOfFoo map[string]Foo
|
||||
MapOfAny map[string]interface{}
|
||||
|
||||
@@ -267,7 +267,7 @@ func In(needle interface{}, array interface{}) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
panic(fmt.Sprintf(`operator "in"" not defined on %T`, array))
|
||||
panic(fmt.Sprintf(`operator "in" not defined on %T`, array))
|
||||
}
|
||||
|
||||
func Len(a interface{}) int {
|
||||
|
||||
Reference in New Issue
Block a user