slices

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone[S ~[]E, E any](s S) S

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