Documentation ¶
Index ¶
- func Any(list []interface{}, compare CompareFunc) bool
- func Contain(list []interface{}, target interface{}) bool
- func Filter(list []interface{}, compare CompareFunc) []interface{}
- func FindIndex(list []interface{}, compare CompareFunc) int
- func First(list []interface{}, compare CompareFunc) interface{}
- func IndexOf(list []interface{}, target interface{}) int
- func IntsToInterfaces(a []int) []interface{}
- func Map(list []interface{}, conv ConvFunc) []interface{}
- func StringsToInterfaces(a []string) []interface{}
- type CompareFunc
- type ConvFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Any ¶
func Any(list []interface{}, compare CompareFunc) bool
Any return if any item in list that satisfies the provided testing function
func Contain ¶
func Contain(list []interface{}, target interface{}) bool
Contain return if list contain the target element
func Filter ¶
func Filter(list []interface{}, compare CompareFunc) []interface{}
Filter return all values in the array that satisfies the provided testing function
func FindIndex ¶
func FindIndex(list []interface{}, compare CompareFunc) int
FindIndex returns the index of the first element in the array that satisfies the provided testing function
func First ¶
func First(list []interface{}, compare CompareFunc) interface{}
First return the value of the first element in the array that satisfies the provided testing function
func IndexOf ¶
func IndexOf(list []interface{}, target interface{}) int
IndexOf returns the first index at which a given element can be found in the
func IntsToInterfaces ¶
func IntsToInterfaces(a []int) []interface{}
IntsToInterfaces used to conv int array to interface array
func Map ¶
func Map(list []interface{}, conv ConvFunc) []interface{}
Map return all the converted value by conv function from the element in the list
func StringsToInterfaces ¶
func StringsToInterfaces(a []string) []interface{}
StringsToInterfaces used to conv string array to interface array
Types ¶
type CompareFunc ¶
type CompareFunc func(item interface{}) bool
CompareFunc used to express compare item fit some conditions