predicate

package
v0.0.0-...-b33464d Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

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

func Any

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

func Filter

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

filters elements of a slice based on a predicate function, returning a new slice containing only elements that match the predicate

func Find

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

returns the first element in the slice that satisfies the specified predicate, or an indication that no such element exists.

func Partition

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

splits the slice into two slices based on a predicate: one for elements that satisfy the predicate and another for those that do not

Types

This section is empty.

Jump to

Keyboard shortcuts

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