Documentation
¶
Index ¶
- func Map(array []interface{}, pred MapPredicate) []interface{}
- func MapBool(array []bool, pred MapBoolPredicate) []bool
- func MapByte(array []byte, pred MapBytePredicate) []byte
- func MapFloat32(array []float32, pred MapFloat32Predicate) []float32
- func MapFloat64(array []float64, pred MapFloat64Predicate) []float64
- func MapInt(array []int, pred MapIntPredicate) []int
- func MapInt16(array []int16, pred MapInt16Predicate) []int16
- func MapInt32(array []int32, pred MapInt32Predicate) []int32
- func MapInt64(array []int64, pred MapInt64Predicate) []int64
- func MapString(array []string, pred MapStringPredicate) []string
- func Reduce(array []interface{}, pred ReducePredicate, initial interface{}) interface{}
- type MapBoolPredicate
- type MapBytePredicate
- type MapFloat32Predicate
- type MapFloat64Predicate
- type MapInt16Predicate
- type MapInt32Predicate
- type MapInt64Predicate
- type MapIntPredicate
- type MapPredicate
- type MapStringPredicate
- type ReducePredicate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Map ¶
func Map(array []interface{}, pred MapPredicate) []interface{}
Map creates a new array populated with the results of calling a provided function on every element in the calling array
func MapBool ¶
func MapBool(array []bool, pred MapBoolPredicate) []bool
MapBool creates a new array populated with the results of calling a provided function on every element in the calling array
func MapByte ¶
func MapByte(array []byte, pred MapBytePredicate) []byte
MapByte creates a new array populated with the results of calling a provided function on every element in the calling array
func MapFloat32 ¶
func MapFloat32(array []float32, pred MapFloat32Predicate) []float32
MapFloat32 creates a new array populated with the results of calling a provided function on every element in the calling array
func MapFloat64 ¶
func MapFloat64(array []float64, pred MapFloat64Predicate) []float64
MapFloat64 creates a new array populated with the results of calling a provided function on every element in the calling array
func MapInt ¶
func MapInt(array []int, pred MapIntPredicate) []int
MapInt creates a new array populated with the results of calling a provided function on every element in the calling array
func MapInt16 ¶
func MapInt16(array []int16, pred MapInt16Predicate) []int16
MapInt16 creates a new array populated with the results of calling a provided function on every element in the calling array
func MapInt32 ¶
func MapInt32(array []int32, pred MapInt32Predicate) []int32
MapInt32 creates a new array populated with the results of calling a provided function on every element in the calling array
func MapInt64 ¶
func MapInt64(array []int64, pred MapInt64Predicate) []int64
MapInt64 creates a new array populated with the results of calling a provided function on every element in the calling array
func MapString ¶
func MapString(array []string, pred MapStringPredicate) []string
MapString creates a new array populated with the results of calling a provided function on every element in the calling array
func Reduce ¶
func Reduce(array []interface{}, pred ReducePredicate, initial interface{}) interface{}
Reduce method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the array is a single value.
Types ¶
type MapFloat32Predicate ¶
MapFloat32Predicate function
type MapFloat64Predicate ¶
MapFloat64Predicate function
type ReducePredicate ¶
type ReducePredicate func(previousValue, currentValue interface{}, idx int) interface{}
ReducePredicate function