Documentation
¶
Index ¶
- Variables
- func As(slice []interface{}) (res []int, err error)
- func Contains(haystack []int, needle int) bool
- func ContainsAll(haystack []int, needles ...int) bool
- func ContainsAny(haystack []int, needles ...int) bool
- func Cut(slice []int, separator int) (left, right []int, found bool)
- func CutAny(val []int, seperators ...int) (left, right []int, found bool)
- func Equal(a []int, b []int) bool
- func Fill(slice []int, val int) []int
- func Index(haystack []int, needle int) int
- func Interface(slice []int) (res []interface{}, err error)
- func Remove(slice []int, offset int, values ...int) (res []int)
- func RemoveAt(slice []int, index int) (res []int)
- func Resize(s []int, n int) (res []int)
- func Sort(s []int)
- func SortReverse(s []int)
- func Split(slice []int, separator int) (parts [][]int)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInterfaceNotInt = errors.New("encountered non-int interface")
)
Functions ¶
func ContainsAll ¶
Check if a []int slice contains ALL of the provided members
func ContainsAny ¶
Check if a []int slice contains ANY of the provided members
func Index ¶
Find the index where the needle appears. Returns -1 if the needle doesn't appear in the slice.
func Remove ¶ added in v0.5.10
Remove the first occurrence of each value from the slice starting from the supplied offset
func RemoveAt ¶ added in v0.5.10
Remove the item at the index while preserving the order of the items TODO: maybe change this to take multiple indices and to remove them at the same time
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.