Discover Packages
github.com/wyattis/z
zslice
zints
package
Version:
v0.10.3
Opens a new window with list of versions in this module.
Published: Nov 18, 2022
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Jump to ...
Documentation
Index
Constants
Variables
Functions
As(slice)
Contains(haystack, needle)
ContainsAll(haystack, needles)
ContainsAny(haystack, needles)
Cut(slice, separator)
CutAny(val, seperators)
CutAt(val, index)
Equal(a, b)
Fill(slice, val)
Index(haystack, needle)
Interface(slice)
Remove(slice, offset, values)
RemoveAt(slice, index)
Resize(s, n)
Sort(s)
SortReverse(s)
Split(slice, separator)
Types
Source Files
Documentation Source Files Index Constants Variables Functions Types As(slice) Contains(haystack, needle) ContainsAll(haystack, needles) ContainsAny(haystack, needles) Cut(slice, separator) CutAny(val, seperators) CutAt(val, index) Equal(a, b) Fill(slice, val) Index(haystack, needle) Interface(slice) Remove(slice, offset, values) RemoveAt(slice, index) Resize(s, n) Sort(s) SortReverse(s) Split(slice, separator)
Documentation
¶
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 CutAt(val []int, index int) (left, right []int)
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)
func As(slice []interface{}) (res []int , err error )
Convert a []interface{} slice into []int slice if possible
Check if a slice ([]int) contains a matching member
func ContainsAll(haystack []int , needles ...int ) bool
Check if a []int slice contains ALL of the provided members
func ContainsAny(haystack []int , needles ...int ) bool
Check if a []int slice contains ANY of the provided members
func Cut(slice []int , separator int ) (left, right []int , found bool )
Cut the slice into two slices separated by the separator
func CutAny(val []int , seperators ...int ) (left, right []int , found bool )
Cut the slice into two slices separated by the first separator
func CutAt(val []int , index int ) (left, right []int )
Cut the slice at the specified index
Determine if two slices are equal to each other
Fill a slice with the given value
Find the index where the needle appears. Returns -1 if the needle doesn't
appear in the slice.
func Interface(slice []int ) (res []interface{}, err error )
Convert a []int slice into a slice of interfaces ([]interface{})
func Remove(slice []int , offset int , values ...int ) (res []int )
Remove the first occurrence of each value from the slice starting from the
supplied offset
func RemoveAt(slice []int , index int ) (res []int )
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
Resize a slice to the given length
Sort the slice in ascending order
func SortReverse(s []int )
Sort the slice in descending order
func Split(slice []int , separator int ) (parts [][]int )
Split the slice into one or more slices separated by the separator
Source Files
¶
Click to show internal directories.
Click to hide internal directories.