Documentation
¶
Overview ¶
Package sliceutils provides utility functions for slices.
Index ¶
- func Difference[T comparable](a, b []T) []T
- func DifferenceFunc[S ~[]E, E any](a, b S, f func(E, E) bool) S
- func EqualContent[S ~[]E, E comparable](a S, b S) bool
- func EqualContentFunc[S ~[]E, E any](a S, b S, f func(E, E) bool) bool
- func Intersection[T comparable](a, b []T) []T
- func Map[T any, S ~[]E, E any](a S, f func(E) T) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Difference ¶
func Difference[T comparable](a, b []T) []T
Difference returns a slice with the elements that are in a but not in b.
func DifferenceFunc ¶
DifferenceFunc returns a slice with the elements that are in a but not in b, supporting a function to compare the items.
func EqualContent ¶
func EqualContent[S ~[]E, E comparable](a S, b S) bool
EqualContent compares two slices, ensuring that their content is equal.
func EqualContentFunc ¶
EqualContentFunc compares two slices, ensuring that their content is equal using the provided function to compare.
func Intersection ¶
func Intersection[T comparable](a, b []T) []T
Intersection returns a slice with the elements that are in both a and b.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.