Files
lo/docs/data/it-uniqby.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

545 B

name, slug, sourceRef, category, subCategory, signatures, playUrl, variantHelpers, similarHelpers, position
name slug sourceRef category subCategory signatures playUrl variantHelpers similarHelpers position
UniqBy uniqby it/seq.go#L225 it sequence
func UniqBy[T any, U comparable, I ~func(func(T) bool)](collection I, transform func(item T) U) I
https://go.dev/play/p/HKrt3AvwMTR
it#slice#uniq
core#slice#uniqby
core#slice#uniq
45

Returns a sequence with duplicate elements removed based on a transform function.

result := it.UniqBy(it.Range(1, 7), func(item int) int {
    return item % 3
})
// [1, 2, 3]