Documentation ¶
Index ¶
- func Contains[T comparable](data []T, v T) bool
- func ElementsMatch(listA, listB interface{}) (ok bool, err error)
- func ElementsMatchImplicit(listA, listB interface{}) bool
- func EqualValues[S ~[]E, E cmp.Ordered](a, b S) bool
- func Filter[T any](data []T, f func(T) bool) []T
- func GetInt(slice []int, index int) (int, bool)
- func GetString(slice []string, index int) (string, bool)
- func InsertStringAt(data []string, i int, v string) []string
- func IntRangeUncapped(in []int, start, end int) []int
- func ObjectsAreEqual(expected, actual interface{}) bool
- func Pop[T any](data []T) (T, []T, error)
- func RemoveFromStrings(slice []string, indexes ...int) []string
- func ToLookupMap[T string | int | strfmt.UUID](data []T) map[T]struct{}
- func ToLookupMapByKey[T any, K string | int | strfmt.UUID](data []T, keyCb func(T) K) map[K]T
- func Unique[T comparable](data []T) []T
- func UniqueByProperty[T comparable](data []T, uniq func(T) any) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](data []T, v T) bool
func ElementsMatch ¶
func ElementsMatchImplicit ¶
func ElementsMatchImplicit(listA, listB interface{}) bool
func EqualValues ¶
EqualValues checks if two slices have equal values, regardless of ordering. This does not recurse into nested slices or structs.
func InsertStringAt ¶
InsertAt inserts v into data at position i
func IntRangeUncapped ¶
func ObjectsAreEqual ¶
func ObjectsAreEqual(expected, actual interface{}) bool
ObjectsAreEqual determines if two objects are considered equal.
This function does no assertion of any kind.
func RemoveFromStrings ¶
func ToLookupMapByKey ¶
func Unique ¶
func Unique[T comparable](data []T) []T
func UniqueByProperty ¶
func UniqueByProperty[T comparable](data []T, uniq func(T) any) []T
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.