Documentation
¶
Index ¶
- func Find[T any](collection []T, predicate func(item T) bool) (T, bool)
- func First[T any](list []T) *T
- func IsEmptyList[T any](value *[]T) bool
- func IsIn[T comparable](arr []T, val T) bool
- func IsNotEmptyList[T any](value *[]T) bool
- func Last[T any](list []T) *T
- func Map[T any, R any](src []T, fn func(T) R) []R
- func MapToSlice[T any](sums map[string]*T) []T
- func RemoveIndex(s []interface{}, index int) []interface{}
- func SliceToMap[T any](sums []T, keyFunc func(T) string) map[string]*T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsEmptyList ¶ added in v1.0.10
func IsIn ¶
func IsIn[T comparable](arr []T, val T) bool
func IsNotEmptyList ¶ added in v1.0.10
func Map ¶ added in v1.0.12
How to use: func (Record) ToStruct() Record {} newRecords := collectionx.Map(records, Record.ToStruct)
func MapToSlice ¶
MapToSlice How to use: slices := MapToSlice(map[string]*int{"key1": pointer.Int(1), "key2": pointer.Int(2)})
func RemoveIndex ¶
func RemoveIndex(s []interface{}, index int) []interface{}
func SliceToMap ¶
SliceToMap How to use: sums := []int{1, 2, 3} keyFunc := func(i int) string { return fmt.Sprintf("key-%d", i) } result := SliceToMap(sums, keyFunc)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.