Iterator: added support for iterators over dictionaries

This commit is contained in:
2026-04-19 15:08:14 +02:00
parent d7dd628fc9
commit 807df0f3a8
7 changed files with 280 additions and 26 deletions
+9
View File
@@ -218,6 +218,15 @@ func ToGoInt(value any, description string) (i int, err error) {
return
}
func ToGoString(value any, description string) (s string, err error) {
if s, ok := value.(string); ok {
return s, nil
} else {
err = fmt.Errorf("%s expected string, got %s (%v)", description, TypeName(value), value)
}
return
}
func ForAll[T, V any](ts []T, fn func(T) V) []V {
result := make([]V, len(ts))
for i, t := range ts {