Documentation ¶
Overview ¶
Package collections allows to interact with lists of things.
Index ¶
- func GetSliceIndexValueE(source string, separator string, index int) (string, error)
- func GetSliceLastValueE(source string, separator string) (string, error)
- func ListContains(haystack []string, needle string) bool
- func ListIntersection(list1 []string, list2 []string) []string
- func ListSubtract(list1 []string, list2 []string) []string
- type SliceValueNotFoundError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSliceIndexValueE ¶ added in v0.41.1
GetSliceIndexValueE will take a source string and returns the value at the given index when split by the separator char.
func GetSliceLastValueE ¶ added in v0.41.1
GetSliceLastValueE will take a source string and returns the last value when split by the separator char.
func ListContains ¶
ListContains returns true if the given list of strings (haystack) contains the given string (needle).
func ListIntersection ¶ added in v0.13.16
ListIntersection returns all the items in both list1 and list2. Note that this will dedup the items so that the output is more predictable. Otherwise, the end list depends on which list was used as the base.
func ListSubtract ¶
ListSubtract removes all the items in list2 from list1.
Types ¶
type SliceValueNotFoundError ¶ added in v0.41.1
type SliceValueNotFoundError struct {
// contains filtered or unexported fields
}
SliceValueNotFoundError is returned when a provided values file input is not found on the host path.
func NewSliceValueNotFoundError ¶ added in v0.41.1
func NewSliceValueNotFoundError(sourceString string) SliceValueNotFoundError
NewSliceValueNotFoundError creates a new slice found error
func (SliceValueNotFoundError) Error ¶ added in v0.41.1
func (err SliceValueNotFoundError) Error() string