3
0

Fix count expr function when typed values are used

This commit is contained in:
Tomaž Jerman
2022-02-14 13:39:45 +01:00
parent d74239c735
commit 78cb155be3

View File

@@ -105,6 +105,10 @@ func count(arr interface{}, v ...interface{}) (count int, err error) {
arr = UntypedValue(arr)
if stv, is := arr.([]TypedValue); is {
if len(v) == 0 {
return len(stv), nil
}
for _, vv := range v {
if occ, err := find(stv, vv); err != nil {
return 0, err