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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user