slices

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 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