slices

package
v2.0.0-beta.53 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyToAll

func ApplyToAll[T, U any](s []T, f func(T) U) []U

ApplyToAll returns a new slice containing the results of applying the function `f` to each element of the original slice `s`.

func Filter

func Filter[T any](s []T, f FilterFunc[T]) []T

Filter returns a new slice containing all values that return `true` for the filter function `f`

Types

type FilterFunc

type FilterFunc[T any] func(T) bool

Jump to

Keyboard shortcuts

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