slices

package
v0.0.0-...-42cc2d4 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0, Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare[E constraints.Ordered](s1, s2 []E) int

func Contains

func Contains[E comparable](s []E, v E) bool

Contains reports whether v is present in s.

func Equal

func Equal[E comparable](s1, s2 []E) bool

Equal reports whether two slices are equal: the same length and all elements equal. If the lengths are different, Equal returns false. Otherwise, the elements are compared in increasing index order, and the comparison stops at the first unequal pair. Floating point NaNs are not considered equal.

func Index

func Index[E comparable](s []E, v E) int

Index returns the index of the first occurrence of v in s, or -1 if not present.

func Unique

func Unique[M ~[]K, K comparable](m M) []K

Types

This section is empty.

Jump to

Keyboard shortcuts

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