slices

package
v0.27.2-rc.3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean[T comparable](slice []T) []T

Clean removes all zero values from a slice.

func Disjoint

func Disjoint[T comparable](a, b []T) bool

Disjoint returns true if the two slices have no elements in common.

func DisjointTransform

func DisjointTransform[T comparable](a, b []T, transformA, transformB TransformFunc[T]) bool

DisjointTransform returns true if the two slices have no elements in common, it takes two transform functions that are applied to the elements of each slice before comparing them.

func Intersection

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

func Uniq

func Uniq[T comparable](s []T) []T

Types

type TransformFunc

type TransformFunc[T comparable] func(T) T

Jump to

Keyboard shortcuts

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