Files
lo/docs/data/it-keyify.md
T
Samuel Berthe fa095e4b4f fix(doc): fix go playground demo URL (#832)
* fix(doc): fix go playground demo URL

* fix(doc): add more go playground demo URL
2026-03-06 00:09:59 +01:00

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
func Keyify[T comparable](collection iter.Seq[T]) map[T]struct{}
https://go.dev/play/p/aHOD29_l-rF
core#slice#keyby
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: {}}