slicez

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: BSD-2-Clause Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Concat added in v0.3.0

func Concat[T any](slices ...[]T) []T

Concat concatenates multiple slices together into a single slice. The input slices are not modified, order is preserved and the returned slice is exactly sized to hold its elements.

func Diff

func Diff[T comparable](a, b []T) []T

Diff returns `a` with all elements occurring in `b` removed.

func Filter

func Filter[T any](a []T, cb func(a T) bool) []T

Filter returns `a` with only the elements for which the callback returned true.

func Sum added in v0.7.0

Sum all entries in a slice together.

func Unique

func Unique[T comparable](a []T) []T

Unique returns `a` with all duplicate elements removed. Order is preserved.

Types

This section is empty.

Jump to

Keyboard shortcuts

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