Documentation ¶
Index ¶
- func Column[T, V any](arr []T, fn func(item T) V) (result []V)
- func ColumnMap[K comparable, V, T any](arr []T, fn func(item T) (K, V)) (result map[K]V)
- func ColumnUnique[T any, V comparable](arr []T, fn func(item T) V) (result []V)
- func InArray[T comparable](v T, arr []T) bool
- func Intersect[T comparable](arr1, arr2 []T) []T
- func Max[T constraints.Ordered](arr []T) (ret T)
- func Merge[T any](arr1, arr2 []T) []T
- func Min[T constraints.Ordered](arr []T) (ret T)
- func NumbersToStrs[T constraints.Integer | constraints.Float](arr []T) []string
- func Reverse[T any](arr []T) []T
- func Split[T any](arr []T, n int) (ret [][]T)
- func Unique[T comparable](arr []T) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Column ¶ added in v1.0.2
func Column[T, V any](arr []T, fn func(item T) V) (result []V)
Column 返回数组对象中的int类型的列组成的数组
func ColumnMap ¶ added in v1.0.2
func ColumnMap[K comparable, V, T any](arr []T, fn func(item T) (K, V)) (result map[K]V)
ColumnMap 返回数组对象属性值映射的map
func ColumnUnique ¶ added in v1.0.2
func ColumnUnique[T any, V comparable](arr []T, fn func(item T) V) (result []V)
ColumnUnique 返回数组对象中的int类型的列组成的数组并去重
func NumbersToStrs ¶
func NumbersToStrs[T constraints.Integer | constraints.Float](arr []T) []string
NumbersToStrs 任意类型slice转为字符串数组
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.