Files
lo/docs/data/it-keyify.md
T
2025-10-06 17:16:33 +02:00

512 B

name, slug, sourceRef, category, subCategory, signatures, variantHelpers, similarHelpers, position
name slug sourceRef category subCategory signatures variantHelpers similarHelpers position
Keyify keyify it/seq.go#L720 it slice
func Keyify[T comparable](collection iter.Seq[T]) map[T]struct{}
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: {}}