Documentation ¶
Index ¶
- Variables
- func As(slice []interface{}) (res []string, err error)
- func Contains(haystack []string, needle string) bool
- func ContainsAll(haystack []string, needles ...string) bool
- func ContainsAny(haystack []string, needles ...string) bool
- func Cut(slice []string, separator string) (left, right []string, found bool)
- func CutAny(val []string, seperators ...string) (left, right []string, found bool)
- func CutAt(val []string, index int) (left, right []string)
- func Equal(a []string, b []string) bool
- func Fill(slice []string, val string) []string
- func Index(haystack []string, needle string) int
- func Interface(slice []string) (res []interface{}, err error)
- func Remove(slice []string, offset int, values ...string) (res []string)
- func RemoveAt(slice []string, index int) (res []string)
- func Resize(s []string, n int) (res []string)
- func Sort(s []string)
- func SortReverse(s []string)
- func Split(slice []string, separator string) (parts [][]string)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInterfaceNotString = errors.New("encountered non-string interface")
)
Functions ¶
func ContainsAll ¶
Check if a []string slice contains ALL of the provided members
func ContainsAny ¶
Check if a []string 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.