collectionx

package
v1.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find[T any](collection []T, predicate func(item T) bool) (T, bool)

func First

func First[T any](list []T) *T

func IsEmptyList added in v1.0.10

func IsEmptyList[T any](value *[]T) bool

func IsIn

func IsIn[T comparable](arr []T, val T) bool

func IsNotEmptyList added in v1.0.10

func IsNotEmptyList[T any](value *[]T) bool

func Last

func Last[T any](list []T) *T

func MapToSlice

func MapToSlice[T any](sums map[string]*T) []T

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

func SliceToMap[T any](sums []T, keyFunc func(T) string) map[string]*T

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL