Thanks to visit codestin.com
Credit goes to pkg.go.dev

slice

package
v0.27.2-0...-a2d64c0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

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 added in v0.7.5

func ContainsCompare[T any](haystack []T, needle T, equal func(a, b T) bool) bool

func Descending

func Descending[T constraints.Ordered](a, b T) int

func New added in v0.17.0

func New[T any](items ...T) []T

New is a convenience method for creating []T.

func Overlap added in v0.7.5

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

Overlap returns if the 2 sets have any overlap (element(s) in common)

func OverlapCompare added in v0.7.5

func OverlapCompare[T any](a []T, b []T, equal func(a, b T) bool) bool

func SameElements added in v0.17.0

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 added in v0.11.0

func Unique[T comparable](a []T) []T

Unique returns a new slice with all duplicate elements removed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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