modulepackage
0.0.0-20230307185351-0220b89822a7
Repository: https://github.com/cyc-ttn/go-collections.git
Documentation: pkg.go.dev
# README
Go Collections
A list of common helper functions for lists and strings.
# Functions
Contains returns true if needle can be found in haystack for any type of slice.
Filter returns a new slice including only items where the provided filter function returns true.
GetFromUrlValues returns the *first* value from a map[string][]string in a certain type whose underlying type is a string.
GetIntFromUrlValues returns a single integer from a map[string][]string by parsing the list of entries in order and returning the first integer entry.
Index returns the index at which needle can be found in haystack for all types of slices.
IndexWhere returns the first index at which the provided [where] function returns true.
Map returns a new slice including the items returned by the provided function, usually a modification or a part of the provided source.
MapUnique is the same as Map but checks first if the converted item is unique.
SelectFromUrlValues provides a way to retrieve a slice of strings from a map[string][]string in a certain type whose underlying type is string.
ToStringSliceOf converts a slice from one type to another.