Files
lo/docs/data/core-findduplicates.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

27 lines
569 B
Markdown

---
name: FindDuplicates
slug: findduplicates
sourceRef: find.go#L207
category: core
subCategory: find
playUrl: https://go.dev/play/p/muFgL_XBwoP
variantHelpers:
- core#find#findduplicates
similarHelpers:
- core#find#findduplicatesby
- core#slice#uniq
- core#slice#finduniques
position: 120
signatures:
- "func FindDuplicates[T comparable, Slice ~[]T](collection Slice) Slice"
---
Returns a slice with the first occurrence of each duplicated element in the collection, preserving order.
```go
lo.FindDuplicates([]int{1, 2, 2, 1, 2, 3})
// []int{1, 2}
```