exslices

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MPL-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

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

Diff returns the difference between two slices. The slices may contain duplicates and don't need to be sorted. The output will not be sorted, but is guaranteed to not contain any duplicates.

func SortedDiff

func SortedDiff[T any](a, b []T, compare func(a, b T) int) (uniqueToA, uniqueToB []T)

SortedDiff returns the difference between two already-sorted slices, with the help of the given comparison function. The output will be in the same order as the input, which means it'll be sorted.

Types

This section is empty.

Jump to

Keyboard shortcuts

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