Docs and sliceutils from and to channel

This commit is contained in:
Melody Becker 2025-06-17 13:28:25 +02:00
parent 3bb1984f1c
commit 7a09569c03
Signed by: mstar
SSH key fingerprint: SHA256:9VAo09aaVNTWKzPW7Hq2LW+ox9OdwmTSHRoD4mlz1yI
2 changed files with 32 additions and 1 deletions

View file

@ -73,6 +73,8 @@ func CompareMap[K, V comparable](a, b map[K]V) bool {
return true
}
// Compact reduces the keys and values of a map down into one value each.
// The starting value for each is the default value of that type.
func Compact[K comparable, V any](
m map[K]V,
compactor func(accK K, accV V, nextK K, nextV V) (K, V),