zints

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInterfaceNotInt = errors.New("encountered non-int interface")
)

Functions

func As

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

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

func Contains

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

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

func ContainsAll

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

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

func ContainsAny

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

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

func Cut

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

Cut the slice into two slices separated by the separator

func CutAny

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

Cut the slice into two slices separated by the first separator

func Equal

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

func Index

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

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

func Interface

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

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

func Split

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

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