package
2.2.5
Repository: https://github.com/teamwork/utils.git
Documentation: pkg.go.dev

# Functions

Choose chooses a random item from the list.
ChooseString see Choose Deprecated: use Choose.
Complement returns the complement of the two lists; that is, the first return value will contain elements that are only in "a" (and not in "b"), and the second return value will contain elements that are only in "b" (and not in "a").
Contains returns true if item is in the provided slice.
CSVtoInt64Slice converts a string of integers to a slice of int64.
Difference returns a new slice with elements that are in "set" but not in "others".
Filter filters a list.
FilterEmpty can be used as an argument for Filter() and will return false if e is zero value.
FilterInt see Filter Deprecated: use Filter.
FilterString see Filter Deprecated: use Filter.
FilterStringEmpty see FilterEmpty Deprecated: use FilterEmpty.
InFoldedStringSlice reports whether str is within list(case-insensitive).
InInt64Slice see Contains Deprecated: use Contains.
InIntSlice see Contains Deprecated: use Contains.
InStringSlice see Contains Deprecated: use Contains.
InterfaceSliceTo converts []interface to any given slice.
Intersection returns the elements common to both a and b.
Join converts a slice of T to a comma separated string.
JoinInt see Join Deprecated: use Join.
JoinWith converts a slice of T to a string using the provided delim.
Map returns a list where each item in list has been modified by fn.
MergeUnique takes a slice of slices and returns an unsorted slice of unique entries.
Range creates an []int counting at "start" up to (and including) "end".
Remove removes any occurrence of a string from a slice.
RemoveString see Remove Deprecated: use Remove.
Repeat returns a slice with the item t reated n times.
RepeatString see Repeat Deprecated: use Repeat.
StringMap see Map Deprecated: use Map.
ToAnySlice converts a slice of T to a slice of any.
UniqInt64 see Unique Deprecated: use Unique.
UniqString see Unique Deprecated: use Unique.
Unique removes duplicate entries from a list.
UniqueMergeSlices see MergeUnique Deprecated: use MergeUnique.
Values returns a list of items extracted from T, see test file for example.