sliceutil

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter[S ~[]In, In any](s S, predicate func(In) bool) S

Filter returns a slice of items which satisfies the predicate.

func Map

func Map[S ~[]In, In, Out any](s S, fn func(In) Out) []Out

Map returns a new slice with the results of applying the given function to each item in the input slice.

This function comes from https://github.com/moby/moby and is subject to the Apache 2.0 license. See:

- https://github.com/moby/moby/blob/82ca3ccaf349ce2df15d19f61f21af480999fccd/internal/sliceutil/sliceutil.go#L18-L24 - https://github.com/moby/moby/blob/82ca3ccaf349ce2df15d19f61f21af480999fccd/LICENSE

Types

This section is empty.

Jump to

Keyboard shortcuts

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