mirror of
https://github.com/samber/lo.git
synced 2026-04-22 15:37:14 +08:00
fa095e4b4f
* fix(doc): fix go playground demo URL * fix(doc): add more go playground demo URL
860 B
860 B
name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
| name | slug | sourceRef | category | subCategory | playUrl | variantHelpers | similarHelpers | position | signatures | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| MinIndexBy | minindexby | find.go#L337 | core | find | https://go.dev/play/p/zwwPRqWhnUY |
|
|
170 |
|
Searches the minimum value using a comparison function and returns the value and its index. Returns (zero value, -1) when empty.
type Point struct{ X int }
value, idx := lo.MinIndexBy([]Point{{1}, {5}, {3}}, func(a, b Point) bool {
return a.X < b.X
})
// value == {1}, idx == 0