mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
b6154d0f8d
* feat: add Take, TakeWhile, FilterTake, Window, and Sliding functions Add five new slice manipulation functions with tests, examples, and documentation. * improve Take function safety and add benchmarks * rename FilterTake to TakeFilter and add README docs * remove Window and Sliding benchmarks * apply gofmt and fix linter errors * apply gofmt and fix linter errors
573 B
573 B
name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
| name | slug | sourceRef | category | subCategory | playUrl | variantHelpers | similarHelpers | position | signatures | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| First | first | find.go#L554 | core | find | https://go.dev/play/p/ul45Z0y2EFO |
|
|
260 |
|
Returns the first element of a collection and whether it exists.
v, ok := lo.First([]int{1, 2, 3})
// v == 1, ok == true