Documentation ¶
Index ¶
- func Contains[T comparable](inputSlice []T, element T) bool
- func ContainsItems[T comparable](s1 []T, s2 []T) bool
- func Dedupe[T comparable](inputSlice []T) (result []T)
- func PickRandom[T any](v []T) T
- func PruneEmptyStrings(v []string) []string
- func PruneEqual[T comparable](inputSlice []T, equalTo T) (r []T)
- func RandSlice(slice interface{})
- func RandomInterface(obj []interface{}) []interface{}
- func RandomString(strings []string) string
- func ToInt(s []string) ([]int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](inputSlice []T, element T) bool
Contains if a slice contains an element
func ContainsItems ¶
func ContainsItems[T comparable](s1 []T, s2 []T) bool
ContainsItems checks if s1 contains s2
func Dedupe ¶
func Dedupe[T comparable](inputSlice []T) (result []T)
Dedupe removes duplicates from a slice of elements preserving the order
func PruneEmptyStrings ¶
PruneEmptyStrings from the slice
func PruneEqual ¶
func PruneEqual[T comparable](inputSlice []T, equalTo T) (r []T)
PruneEqual removes items from the slice equal to the specified value
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.