utils.go:fromGenericAny() now supports also ListType and DictType

This commit is contained in:
Celestino Amoroso 2024-05-19 01:21:06 +02:00
parent 2b184cf3f2
commit 9bd4a0ba23

View File

@ -35,7 +35,7 @@ func IsList(v any) (ok bool) {
} }
func IsDict(v any) (ok bool) { func IsDict(v any) (ok bool) {
_, ok = v.(map[any]any) _, ok = v.(*DictType)
return ok return ok
} }
@ -147,6 +147,12 @@ func fromGenericAny(v any) (exprAny any, ok bool) {
if exprAny, ok = anyFloat(v); ok { if exprAny, ok = anyFloat(v); ok {
return return
} }
if exprAny, ok = v.(*DictType); ok {
return
}
if exprAny, ok = v.(*ListType); ok {
return
}
return return
} }