added docker image

This commit is contained in:
Simon Martens
2024-12-06 13:39:26 +01:00
parent 93e107e442
commit 97901b8a44
4 changed files with 64 additions and 0 deletions

18
functions/iterables.go Normal file
View File

@@ -0,0 +1,18 @@
package functions
func MapArrayInsert[K comparable, V any](m map[K][]V, k K, v V) {
l, ok := m[k]
if !ok {
m[k] = []V{v}
} else {
m[k] = append(l, v)
}
}
func Keys[K comparable, V any](m map[K]V) []K {
keys := make([]K, 0, len(m))
for k := range m {
keys = append(keys, k)
}
return keys
}

12
functions/sorting.go Normal file
View File

@@ -0,0 +1,12 @@
package functions
import (
"golang.org/x/text/collate"
"golang.org/x/text/language"
)
func Sort(s []string) []string {
c := collate.New(language.German, collate.IgnoreCase)
c.SortStrings(s)
return s
}