@@ -105,6 +105,7 @@ Supported helpers for slices:
105
105
- [ DropRight] ( #dropright )
106
106
- [ DropWhile] ( #dropwhile )
107
107
- [ DropRightWhile] ( #droprightwhile )
108
+ - [ DropByIndex] ( #DropByIndex )
108
109
- [ Reject] ( #reject )
109
110
- [ RejectMap] ( #rejectmap )
110
111
- [ FilterReject] ( #filterreject )
@@ -775,8 +776,8 @@ l := lo.DropRightWhile([]string{"a", "aa", "aaa", "aa", "aa"}, func(val string)
775
776
Drops elements from a slice or array by the index. A negative index will drop elements from the end of the slice.
776
777
777
778
``` go
778
- l := lo.Drop ([]int {0 , 1 , 2 , 3 , 4 , 5 }, 2 , 4 , -1 )
779
- // []int{2 , 3}
779
+ l := lo.DropByIndex ([]int {0 , 1 , 2 , 3 , 4 , 5 }, 2 , 4 , -1 )
780
+ // []int{0, 1 , 3}
780
781
```
781
782
782
783
[[ play] ( https://go.dev/play/p/JswS7vXRJP2 )]
@@ -1649,7 +1650,7 @@ err, duration := lo.Duration1(func() error {
1649
1650
// an error
1650
1651
// 3s
1651
1652
1652
- err , duration := lo.Duration3 (func () (string , int , error ) {
1653
+ str , nbr , err , duration := lo.Duration3 (func () (string , int , error ) {
1653
1654
// very long job
1654
1655
return " hello" , 42 , nil
1655
1656
})
0 commit comments