Documentation
¶
Overview ¶
Package code from: https://github.com/beego/beego/blob/develop/core/utils/slice.go
Index ¶
- func Chunk(slice []any, size int) (chunkSlice [][]any)
- func Diff(slice1, slice2 []any) (diffSlice []any)
- func Filter(slice []any, a func(any) bool) (filterSlice []any)
- func InInterface(v any, sl []any) bool
- func Int32In(v int32, sl []int32) (int, bool)
- func Int64In(v int64, sl []int64) (int, bool)
- func Intersect(slice1, slice2 []any) (diffSlice []any)
- func IsEmptyWithString(p []string) bool
- func IsSlice(value any) bool
- func Merge(slice1, slice2 []any) (c []any)
- func Pad(slice []any, size int, val any) []any
- func Rand(a []any) (b any)
- func RandList(minValue, maxValue int) []int
- func Range(start, end, step int64) (intSlice []int64)
- func Reduce(slice []any, a func(any) any) (destSlice []any)
- func Shuffle(slice []any) []any
- func StringIn(v string, sl []string) (int, bool)
- func StringInSlice(v string, sl []string) bool
- func StringToInt(strSlice []string) []int
- func StringToInt32(strSlice []string) []int32
- func StringToInt64(strSlice []string) []int64
- func Sum(intslice []int64) (sum int64)
- func Unique[T comparable](slice ...T) []T
- func Uniques[T comparable](slices ...[]T) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InInterface ¶
InInterface checks given interface in interface slice.
func IsEmptyWithString ¶
func IsSlice ¶
IsSlice checks whether given value is array/slice. Note that it uses reflect internally implementing this feature.
func StringInSlice ¶
func StringToInt ¶
func StringToInt32 ¶
func StringToInt64 ¶
func Uniques ¶
func Uniques[T comparable](slices ...[]T) []T
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.