fns

package
v1.27.3 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MPL-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseIgnore added in v1.25.0

func CloseIgnore(c io.Closer)

CloseIgnore closes c, ignoring any error. Its main use is to satisfy linters.

func Filter

func Filter[Elem any](src []Elem, fn func(Elem) bool) []Elem

Filter applies fn on all elements in src, producing a new slice containing the elements for which fn returned true, preserving the same order.

func Map

func Map[A, B any](src []A, fn func(A) B) []B

Map applies fn on all elements in src, producing a new slice with the results, in order.

func MapKeys added in v1.25.0

func MapKeys[M ~map[K]V, K comparable, V any](m M) []K

MapKeys returns the keys of the map m. The keys will be in an indeterminate order.

Types

This section is empty.

Jump to

Keyboard shortcuts

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