slice

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal added in v1.0.8

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

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

func FirstOr added in v1.0.12

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

FirstOr get first elem or elseVal

func Keys added in v1.0.8

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

func Last

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

func LastOr added in v1.0.12

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

LastOr get last elem or elseVal

func Merge added in v1.0.9

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 added in v1.0.8

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