slices

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[S ~[]T, T comparable](s S, t T) bool

Contains returns true if the slice contains the given element.

func Filter

func Filter[S ~[]T, T any](s S, f func(T) bool) []T

Filter returns a new slice containing all elements in the slice that satisfy the predicate f.

func Find

func Find[S ~[]T, T any](s S, f func(T) bool) (t T, ok bool)

Find returns the first element in the slice that satisfies the predicate f.

func Map

func Map[S ~[]T, T any, O any](s S, f func(T) O) []O

Map returns a new slice containing the results of applying the given function

Types

This section is empty.

Jump to

Keyboard shortcuts

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