fixed some defects in the iter-list implementation
This commit is contained in:
@@ -204,8 +204,10 @@ func CloneFilteredMap[K comparable, V any](source map[K]V, filter func(key K) (a
|
||||
func toInt(value any, description string) (i int, err error) {
|
||||
if valueInt64, ok := value.(int64); ok {
|
||||
i = int(valueInt64)
|
||||
} else if valueInt, ok := value.(int); ok {
|
||||
i = valueInt
|
||||
} else {
|
||||
err = fmt.Errorf("%s expected integer, got %T (%v)", description, value, value)
|
||||
err = fmt.Errorf("%s expected integer, got %s (%v)", description, typeName(value), value)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user