collectionutils

package
v0.0.0-...-0c6c348 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T any](collection []T, predicate func(T) bool) bool

Contains checks if any element in the collection satisfies the predicate.

func ContainsAll

func ContainsAll[T any](collection []T, predicate func(T) bool) bool

ContainsAll checks if all elements in the collection satisfy the predicate.

func Equals

func Equals[T comparable](a, b []T) bool

Equals checks if two slices are equal.

func FindFirst

func FindFirst[T any](slice []T, predicate func(T) bool) (T, bool)

FindFirst returns the first element in the slice for which the predicate returns true. If no element satisfies the predicate, it returns the zero value of the type and false.

func Map

func Map[T any, U any](input []T, f func(T) U) []U

Map applies a function to each element of a slice and returns a new slice with the results.

Types

This section is empty.

Jump to

Keyboard shortcuts

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