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

doc: update doc for v2.3.1

This commit is contained in:
dudaodong
2024-05-14 11:25:01 +08:00
parent 967e6a3493
commit 6e0498514c
8 changed files with 216 additions and 121 deletions

View File

@@ -1254,7 +1254,7 @@ func Partition[T any](slice []T, predicates ...func(item T) bool) [][]T {
}
// Breaks a list into two parts at the point where the predicate for the first time is true.
// Play: Todo
// Play: https://go.dev/play/p/yLYcBTyeQIz
func Break[T any](values []T, predicate func(T) bool) ([]T, []T) {
a := make([]T, 0)
b := make([]T, 0)
@@ -1289,7 +1289,7 @@ func Random[T any](slice []T) (val T, idx int) {
}
// RightPadding adds padding to the right end of a slice.
// Play: Todo
// Play: https://go.dev/play/p/0_2rlLEMBXL
func RightPadding[T any](slice []T, paddingValue T, paddingLength int) []T {
if paddingLength == 0 {
return slice
@@ -1301,7 +1301,7 @@ func RightPadding[T any](slice []T, paddingValue T, paddingLength int) []T {
}
// LeftPadding adds padding to the left begin of a slice.
// Play: Todo
// Play: https://go.dev/play/p/jlQVoelLl2k
func LeftPadding[T any](slice []T, paddingValue T, paddingLength int) []T {
if paddingLength == 0 {
return slice