zuints

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInterfaceNotUint = errors.New("encountered non-uint interface")
)

Functions

func As

func As(slice []interface{}) (res []uint, err error)

Convert a []interface{} slice into []uint slice if possible

func Contains

func Contains(haystack []uint, needle uint) bool

Check if a slice ([]uint) contains a matching member

func ContainsAll

func ContainsAll(haystack []uint, needles ...uint) bool

Check if a []uint slice contains ALL of the provided members

func ContainsAny

func ContainsAny(haystack []uint, needles ...uint) bool

Check if a []uint slice contains ANY of the provided members

func Cut

func Cut(slice []uint, separator uint) (left, right []uint, found bool)

Cut the slice into two slices separated by the separator

func CutAny

func CutAny(val []uint, seperators ...uint) (left, right []uint, found bool)

Cut the slice into two slices separated by the first separator

func Equal

func Equal(a []uint, b []uint) bool

Determine if two slices are equal to each other

func Index

func Index(haystack []uint, needle uint) int

Find the index where the needle appears. Returns -1 if the needle doesn't appear in the slice.

func Interface

func Interface(slice []uint) (res []interface{}, err error)

Convert a []uint slice into a slice of interfaces ([]interface{})

func Sort added in v0.5.6

func Sort(s []uint)

Sort the slice

func SortReverse added in v0.5.7

func SortReverse(s []uint)

func Split

func Split(slice []uint, separator uint) (parts [][]uint)

Split the slice into one or more slices separated by the separator

Types

This section is empty.

Jump to

Keyboard shortcuts

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