Documentation
¶
Index ¶
- func EQ[T comparable, S ~[]T](s S, s2 S) (bool, []base.ErrorParam)
- func ElemIn[T comparable, S ~[]T](s S, values ...T) (bool, []base.ErrorParam)
- func ElemNotIn[T comparable, S ~[]T](s S, values ...T) (bool, []base.ErrorParam)
- func ElemRange[T base.Number | base.String, S ~[]T](s S, min, max T) (bool, []base.ErrorParam)
- func HasElem[T comparable, S ~[]T](s S, values ...T) (bool, []base.ErrorParam)
- func HasElemBy[T any, S ~[]T](s S, isExistFn func(T) bool) (bool, []base.ErrorParam)
- func Len[T any, S ~[]T](s S, min, max int) (bool, []base.ErrorParam)
- func NotHaveElem[T comparable, S ~[]T](s S, values ...T) (bool, []base.ErrorParam)
- func NotHaveElemBy[T any, S ~[]T](s S, isExistFn func(T) bool) (bool, []base.ErrorParam)
- func Sorted[T base.Number | base.String, S ~[]T](s S) (bool, []base.ErrorParam)
- func SortedBy[T any, U base.Number | base.String, S ~[]T](s S, keyFn func(T) U) (bool, []base.ErrorParam)
- func SortedDesc[T base.Number | base.String, S ~[]T](s S) (bool, []base.ErrorParam)
- func SortedDescBy[T any, U base.Number | base.String, S ~[]T](s S, keyFn func(T) U) (bool, []base.ErrorParam)
- func Unique[T comparable, S ~[]T](s S) (bool, []base.ErrorParam)
- func UniqueBy[T any, U comparable, S ~[]T](s S, keyFn func(T) U) (bool, []base.ErrorParam)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EQ ¶
func EQ[T comparable, S ~[]T](s S, s2 S) (bool, []base.ErrorParam)
EQ checks a slice must equal to a slice
func ElemIn ¶
func ElemIn[T comparable, S ~[]T](s S, values ...T) (bool, []base.ErrorParam)
ElemIn checks slice items must be in a list
func ElemNotIn ¶
func ElemNotIn[T comparable, S ~[]T](s S, values ...T) (bool, []base.ErrorParam)
ElemNotIn checks slice items must be not in a list
func ElemRange ¶
ElemRange checks slice items must be in a range (applies to item type string or number only)
func HasElem ¶ added in v1.2.0
func HasElem[T comparable, S ~[]T](s S, values ...T) (bool, []base.ErrorParam)
HasElem checks slice must contain the specified values
func HasElemBy ¶ added in v1.2.0
func HasElemBy[T any, S ~[]T](s S, isExistFn func(T) bool) (bool, []base.ErrorParam)
HasElemBy checks slice must contain values using custom function
func Len ¶
func Len[T any, S ~[]T](s S, min, max int) (bool, []base.ErrorParam)
Len checks slice length must be in a range
func NotHaveElem ¶ added in v1.2.0
func NotHaveElem[T comparable, S ~[]T](s S, values ...T) (bool, []base.ErrorParam)
NotHaveElem checks slice must not contain the specified values
func NotHaveElemBy ¶ added in v1.2.0
func NotHaveElemBy[T any, S ~[]T](s S, isExistFn func(T) bool) (bool, []base.ErrorParam)
NotHaveElemBy checks slice must not contain values using custom function
func SortedBy ¶ added in v1.1.0
func SortedBy[T any, U base.Number | base.String, S ~[]T](s S, keyFn func(T) U) (bool, []base.ErrorParam)
SortedBy checks slice items must be in ascending order defined by the function
func SortedDesc ¶
SortedDesc checks slice items must be in descending order
func SortedDescBy ¶ added in v1.1.0
func SortedDescBy[T any, U base.Number | base.String, S ~[]T](s S, keyFn func(T) U) (bool, []base.ErrorParam)
SortedDescBy checks slice items must be in descending order defined by the function
func Unique ¶
func Unique[T comparable, S ~[]T](s S) (bool, []base.ErrorParam)
Unique checks slice items must be unique
func UniqueBy ¶ added in v1.1.0
func UniqueBy[T any, U comparable, S ~[]T](s S, keyFn func(T) U) (bool, []base.ErrorParam)
UniqueBy checks slice items must be unique
Types ¶
This section is empty.