package
Version:
v1.119.0-rc
Opens a new window with list of versions in this module.
Published: Dec 4, 2024
License: AGPL-3.0
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
-
func Convert[In, Out any](xs []In, fn func(In) (Out, error)) ([]Out, error)
-
func ConvertErrs[In, Out any](xs []In, fn func(In) (Out, error)) ([]Out, []error)
-
func Map[In, Out any](xs []In, fn func(In) Out) []Out
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[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[In, Out any](xs []In, fn func(In) Out) []Out
Map converts xs by applying fn to each element.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.