Initial import

This commit is contained in:
2025-10-10 10:05:13 +02:00
parent 3effc1597b
commit b96b6e7f8f
164 changed files with 5473 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
package stringutil
import "sort"
func MapKeys(m map[string]string) <-chan string {
ch := make(chan string)
if m == nil {
close(ch)
} else {
go func(ch chan<- string) {
defer close(ch)
keys := make([]string, 0, len(m))
for k := range m {
keys = append(keys, k)
}
sort.Strings(keys)
for _, k := range keys {
ch <- k
}
}(ch)
}
return ch
}