Docs and sliceutils from and to channel
This commit is contained in:
parent
3bb1984f1c
commit
7a09569c03
2 changed files with 32 additions and 1 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue