mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
fa095e4b4f
* fix(doc): fix go playground demo URL * fix(doc): add more go playground demo URL
555 B
555 B
name, slug, sourceRef, category, subCategory, signatures, playUrl, variantHelpers, similarHelpers, position
| name | slug | sourceRef | category | subCategory | signatures | playUrl | variantHelpers | similarHelpers | position | ||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Keyify | keyify | it/seq.go#L720 | it | slice |
|
https://go.dev/play/p/aHOD29_l-rF |
|
202 |
Keyify returns a map with each unique element of the sequence as a key.
collection := func(yield func(int) bool) {
yield(1)
yield(2)
yield(1)
yield(3)
yield(2)
}
keyMap := it.Keyify(collection)
// keyMap contains {1: {}, 2: {}, 3: {}}