Documentation ¶
Index ¶
- func Arrange[T any, O constraints.Ordered](elems []T, getKey func(T) O) []T
- func EveryNil(elems ...any) bool
- func IndexOf[T comparable](slice, sub []T) int
- func LastIndexOf[T comparable](slice, sub []T) int
- func Must[T any](val T, err error, messageArgs ...any) T
- func Must0(err error, messageArgs ...any)
- func Must1[T any](val T, err error, messageArgs ...any) T
- func Must2[T1, T2 any](val1 T1, val2 T2, err error, messageArgs ...any) (T1, T2)
- func Must3[T1, T2, T3 any](val1 T1, val2 T2, val3 T3, err error, messageArgs ...any) (T1, T2, T3)
- func Must4[T1, T2, T3, T4 any](val1 T1, val2 T2, val3 T3, val4 T4, err error, messageArgs ...any) (T1, T2, T3, T4)
- func Must5[T1, T2, T3, T4, T5 any](val1 T1, val2 T2, val3 T3, val4 T4, val5 T5, err error, messageArgs ...any) (T1, T2, T3, T4, T5)
- func Must6[T1, T2, T3, T4, T5, T6 any](val1 T1, val2 T2, val3 T3, val4 T4, val5 T5, val6 T6, err error, ...) (T1, T2, T3, T4, T5, T6)
- func Pull[V comparable](collection []V, elements ...V) []V
- func PullAt[V any](collection []V, indices ...int) []V
- func Remove[V comparable](collection []V, predicate func(V, int) bool) []V
- func SampleBool() bool
- func SomeNil(elems ...any) bool
- func Split[T comparable](collection []T, isSeparator func(T, int) bool) [][]T
- func SplitStr(str string, separators ...rune) []string
- type Sunday
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Arrange ¶ added in v1.0.28
func Arrange[T any, O constraints.Ordered](elems []T, getKey func(T) O) []T
Arrange 整理成员执行顺序,key相等的避免同时执行.
func IndexOf ¶ added in v1.0.31
func IndexOf[T comparable](slice, sub []T) int
func LastIndexOf ¶ added in v1.0.31
func LastIndexOf[T comparable](slice, sub []T) int
func Remove ¶
func Remove[V comparable](collection []V, predicate func(V, int) bool) []V
Remove 根据断言删除.
func Split ¶
func Split[T comparable](collection []T, isSeparator func(T, int) bool) [][]T
Split 切片分解.
Types ¶
type Sunday ¶ added in v1.0.35
type Sunday[C comparable] struct { // contains filtered or unexported fields }
Sunday 算法数组查找.
func NewSunday ¶ added in v1.0.35
func NewSunday[C comparable](sub []C) *Sunday[C]
NewSunday 新建 Sunday 算法.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.