1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-03-01 00:35: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

@@ -399,9 +399,9 @@ func ConvertSlice(originalSlice interface{}, newSliceType reflect.Type) interfac
func Difference[T comparable](slice1, slice2 []T) []T //返回切片其元素在slice1中不在slice2中
func DeleteByIndex[T any](slice []T, start int, end ...int) []T //删除切片中start到end位置的值(不包含end)
func Drop[T any](slice []T, n int) []T //创建一个新切片当n大于0时删除原切片前n个元素当n小于0时删除原切片后n个元素
func Every[T any](slice []T, fn func(index int, t T) bool) bool //slice中所有元素都符合函数条件时返回true, 否则返回false. 函数签名func(index int, t T) bool
func None[T any](slice []T, fn func(index int, t T) bool) bool //slice中所有元素都不符合函数条件时返回true, 否则返回false. 函数签名func(index int, value interface{}) bool
func Find[T any](slice []T, fn func(index int, t T) bool) (*T, bool)//查找slice中第一个符合条件的元素函数签名func(index int, value interface{}) bool
func Every[T any](slice []T, fn func(index int, t T) bool) bool //slice中所有元素都符合函数条件时返回true, 否则返回false. 函数签名func(int, t T) bool
func None[T any](slice []T, fn func(index int, t T) bool) bool //slice中所有元素都不符合函数条件时返回true, 否则返回false. 函数签名func(int, T) bool
func Find[T any](slice []T, fn func(index int, t T) bool) (*T, bool)//查找slice中第一个符合条件的元素函数签名func(int, T) bool
func Filter [T any] (slice []T, fn func(index int, t T) bool) []T //过滤slice
func FlattenDeep(slice interface{}) interface{} //将slice递归为一维切片
func ForEach [T any] (slice []T, fn func(index int, t T)) //遍历切片,在每个元素上执行函数