slices2

package
v1.113.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert[In, Out any](xs []In, fn func(In) (Out, error)) ([]Out, error)

Convert converts xs by applying fn to each element. If there's an error during conversion, the function returns an empty slice and the error.

func ConvertErrs

func ConvertErrs[In, Out any](xs []In, fn func(In) (Out, error)) ([]Out, []error)

ConvertErrs converts xs by applying fn to each element. It returns all the successfully converted values and returns the list of errors separately.

func Map

func Map[In, Out any](xs []In, fn func(In) Out) []Out

Map converts xs by applying fn to each element.

Types

This section is empty.

Jump to

Keyboard shortcuts

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