Documentation
¶
Index ¶
- func Ascending[T constraints.Ordered](a, b T) int
- func Contains[T comparable](haystack []T, needle T) bool
- func ContainsCompare[T any](haystack []T, needle T, equal func(a, b T) bool) bool
- func Descending[T constraints.Ordered](a, b T) int
- func New[T any](items ...T) []T
- func Omit[T comparable](a []T, omits ...T) []T
- func Overlap[T comparable](a []T, b []T) bool
- func OverlapCompare[T any](a []T, b []T, equal func(a, b T) bool) bool
- func SameElements[T comparable](a []T, b []T) bool
- func Unique[T comparable](a []T) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ascending ¶
func Ascending[T constraints.Ordered](a, b T) int
func Contains ¶
func Contains[T comparable](haystack []T, needle T) bool
func ContainsCompare ¶
func Descending ¶
func Descending[T constraints.Ordered](a, b T) int
func Omit ¶ added in v2.12.0
func Omit[T comparable](a []T, omits ...T) []T
Omit creates a new slice with the arguments omitted from the list.
func Overlap ¶
func Overlap[T comparable](a []T, b []T) bool
Overlap returns if the 2 sets have any overlap (element(s) in common)
func OverlapCompare ¶
func SameElements ¶
func SameElements[T comparable](a []T, b []T) bool
SameElements returns true if the 2 lists have the same elements in any order.
func Unique ¶
func Unique[T comparable](a []T) []T
Unique returns a new slice with all duplicate elements removed.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.