Documentation ¶
Index ¶
- func All(arr interface{}, fn func(i int, v interface{}) bool) bool
- func Any(arr interface{}, fn func(i int, v interface{}) bool) bool
- func ChangeIndex(arr interface{}, i, j int)
- func ChangeMapKey(m interface{}, r interface{}, field string)
- func Col(arr interface{}, result interface{}, field string)
- func ColInt(arr interface{}, field string) []int
- func ColInt2Str(arr interface{}, field string, fn func(id int) string) []string
- func ColIntMap(arr interface{}, field string) map[int]bool
- func ColIntUnique(arr interface{}, field string) []int
- func ColNullInt(arr interface{}, field string) []null.Int
- func ColNullIntValues(arr interface{}, field string) []int
- func ColNullIntValuesUnique(arr interface{}, field string) []int
- func CopySlice(src interface{}, dst interface{}, fields ...string)
- func Filter(arr interface{}, fn func(i int, v interface{}) bool) interface{}
- func Gather(arr interface{}, field string, ids []int) interface{}
- func Group(arr interface{}, m interface{}, field string)
- func GroupFunc(arr interface{}, m interface{}, cb func(i int) interface{})
- func GroupInto(arr interface{}, m interface{}, field, intoField string)
- func GroupIntoFunc(arr interface{}, m interface{}, cb func(i int) interface{}, intoField string)
- func GroupOne(arr interface{}, m interface{}, field string)
- func GroupOneFunc(arr interface{}, m interface{}, cb func(i int) interface{})
- func Index(arr interface{}, field string, value interface{}) int
- func IntsIndexMap(arr []int) map[int]int
- func IntsNotInArray(ids []int, arr interface{}, field string) []int
- func Join(a interface{}, b interface{}, r interface{})
- func LE(a, b interface{}) (bool, error)
- func Map(arr interface{}, result interface{}, fn func(i int, v interface{}) interface{})
- func MapIds(ids []int, fn func(id int) string) []string
- func MapKeys(m interface{}, r interface{})
- func MapKeysInt(m interface{}) []int
- func MapKeysString(m interface{}) []string
- func MapValues(m interface{}, r interface{})
- func Reduce(arr interface{}, fn func(i int) interface{})
- func SetInt(ints []int) map[int]bool
- func SetInt64(ints []int64) map[int64]bool
- func SetString(values []string) map[string]bool
- func Sort(arr interface{}, fieldAsc ...interface{})
- func SortLikeInts(arr interface{}, field string, orderedInts []int)
- func ToMapIndex(ints []int) map[int]int
- func Unique(ids []int) []int
- func UniqueInts(vs []int) []int
- func UniqueStrs(ss []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeMapKey ¶
func ChangeMapKey(m interface{}, r interface{}, field string)
ChangeMapKey 修改字典的键。
func ColIntUnique ¶
func ColNullInt ¶
func ColNullInt(arr interface{}, field string) []null.Int
func ColNullIntValues ¶
func ColNullIntValuesUnique ¶
func Group ¶
func Group(arr interface{}, m interface{}, field string)
Group group []T -> map[field][]T
func GroupIntoFunc ¶
func GroupOne ¶
func GroupOne(arr interface{}, m interface{}, field string)
GroupOne []T -> map[field]T , m should be map ref *map
func GroupOneFunc ¶
func GroupOneFunc(arr interface{}, m interface{}, cb func(i int) interface{})
func IntsNotInArray ¶
func MapKeysInt ¶
func MapKeysInt(m interface{}) []int
func MapKeysString ¶
func MapKeysString(m interface{}) []string
func Reduce ¶
func Reduce(arr interface{}, fn func(i int) interface{})
func Map(arr interface{}, r interface{}, fn func(i int) interface{}) { arrV := reflect.ValueOf(arr) arrLen := arrV.Len() rT := reflect.TypeOf(r).Elem() rV := reflect.MakeSlice(rT, arrLen, arrLen) for i := 0; i < arrLen; i++ { rV.Index(i).Set(reflect.ValueOf(fn(i))) } reflect.ValueOf(r).Elem().Set(rV) }
func MapString(arr interface{}, fn func(i int) interface{}) []string { var r []string Map(arr, &r, fn) return r }
func Sort ¶
func Sort(arr interface{}, fieldAsc ...interface{})
Sort 排序结构体数组 。arr:[]T,fieldAsc : field true|false,...
func SortLikeInts ¶
func UniqueInts ¶
func UniqueStrs ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.