slice

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

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

Equal compare two slice @notice: don't check sequence

func FirstOr

func FirstOr[T any](sl []T, elseVal T) T

FirstOr get first elem or elseVal

func Keys

func Keys[K comparable, V any](m map[K]V) []K

func Last

func Last[E any](s []E) (E, bool)

func LastOr

func LastOr[T any](sl []T, elseVal T) T

LastOr get last elem or elseVal

func Merge

func Merge[T any](a []T, b []T, cc ...[]T) []T

func NotIn

func NotIn[T comparable](input T, candidates []T) bool

func OneOf

func OneOf[T comparable](input T, candidates []T) bool

func StrictEqual

func StrictEqual[T cmp.Ordered](a, b []T) bool

Types

type Slice

type Slice[T cmp.Ordered] []T

func (Slice[T]) Len

func (s Slice[T]) Len() int

func (Slice[T]) Less

func (s Slice[T]) Less(i, j int) bool

func (Slice[T]) Swap

func (s Slice[T]) Swap(i, j int)

Jump to

Keyboard shortcuts

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