Back to Lo

Core Findduplicatesby

docs/data/core-findduplicatesby.md

1.53.0200 B
Original Source

Returns a slice with the first occurrence of each duplicated element by key, preserving order.

go
lo.FindDuplicatesBy([]int{3, 4, 5, 6, 7}, func(i int) int {
    return i % 3
})
// []int{3, 4}