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

doc: update for release v2.2.8

This commit is contained in:
dudaodong
2023-12-11 15:30:33 +08:00
parent c5297ec329
commit 96320069f4
9 changed files with 29 additions and 19 deletions

View File

@@ -1232,7 +1232,7 @@ func Partition[T any](slice []T, predicates ...func(item T) bool) [][]T {
}
// Random get a random item of slice, return idx=-1 when slice is empty
// Play: todo
// Play: https://go.dev/play/p/UzpGQptWppw
func Random[T any](slice []T) (val T, idx int) {
if len(slice) == 0 {
return val, -1