1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-11 00:02:28 +08:00

update: make func comment consistent

This commit is contained in:
dudaodong
2022-01-11 19:33:15 +08:00
parent f1d7154179
commit 3dadfa234b
3 changed files with 38 additions and 8 deletions

View File

@@ -401,7 +401,7 @@ func Drop[T any](slice []T, n int) []T //creates a slice with `n` elements dropp
func Every[T any](slice []T, fn func(index int, t T) bool) bool //return true if all of the values in the slice pass the predicate function
func None[T any](slice []T, fn func(index int, t T) bool) bool // return true if all the values in the slice mismatch the criteria
func Filter [T any] (slice []T, fn func(index int, t T) bool) []T //filter slice, fn signature should be func(int, T) bool.
func Find[T any](slice []T, fn func(index int, t T) bool) (*T, bool) //iterates over elements of slice, returning the first one that passes a truth test on function.function signature should be func(index int, value interface{}) bool .
func Find[T any](slice []T, fn func(index int, t T) bool) (*T, bool) //iterates over elements of slice, returning the first one that passes a truth test on function.function signature should be func(int, T) bool .
func FlattenDeep(slice interface{}) interface{} //flattens slice recursive
func ForEach [T any] (slice []T, fn func(index int, t T)) //iterates over elements of slice and invokes function for each element, fn signature should be func(int, T ).
func IntSlice(slice interface{}) ([]int, error) //convert value to int slice