Help us shape the future of Go! Take the 2026 Go Developer Survey

sliceutil

package
v0.44.3 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Difference added in v0.28.0

func Difference[S ~[]In, In comparable](s1 S, s2 S) S

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