Documentation
¶
Index ¶
- func Filter[T any](slice []T, fn func(T) bool) []T
- func FilterMap[K comparable, V any](m map[K]V, fn func(V) bool) map[K]V
- func Find[T constraints.Ordered](s []T, elem T) int
- func FindAll[T any](s []T, fn func(T) bool) map[int]T
- func FindBy[T any](s []T, fn func(T) bool) int
- func IsAlnum(ch byte) bool
- func IsAlpha(ch byte) bool
- func IsBlank(ch byte) bool
- func IsCntrl(ch byte) bool
- func IsDigit(ch byte) bool
- func IsGraph(ch byte) bool
- func IsLower(ch byte) bool
- func IsPrint(ch byte) bool
- func IsPunct(ch byte) bool
- func IsSpace(ch byte) bool
- func IsUpper(ch byte) bool
- func IsXdigit(ch byte) bool
- func Keys[K comparable, V any](m map[K]V) []K
- func Map[T any](slice []T, fn func(T) T)
- func MapBy[T any](slice []T, fn func(*T))
- func Max[T constraints.Ordered](s []T) int
- func MaxBy[T any](s []T, fn func(T, T) int) int
- func Min[T constraints.Ordered](s []T) int
- func MinBy[T any](s []T, fn func(T, T) int) int
- func ToLower(ch byte) byte
- func ToUpper(ch byte) byte
- func Values[K comparable, V any](m map[K]V) []V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
Filter returns all the elements from the collection which satisfies the conditional logic of callback function
func FilterMap ¶
func FilterMap[K comparable, V any](m map[K]V, fn func(V) bool) map[K]V
FilterMap iterates over the elements of a collection and returns a new collection representing all the items which satisfies the criteria formulated in the callback function
func Find ¶
func Find[T constraints.Ordered](s []T, elem T) int
Find returns the index of the first found element
func FindAll ¶
FindAll returns a map whose key is the index of the element that meets the criteria and value is the element that meets the criteria
func Keys ¶
func Keys[K comparable, V any](m map[K]V) []K
Keys retrieve all the existing keys of a map
func Max ¶
func Max[T constraints.Ordered](s []T) int
Max returns the index of the maximum value in slice
func MaxBy ¶
MaxBy returns the index of the maximum value in slice fn first element greater than the second element returns 1, equality returns 0, and less than -1
func Min ¶
func Min[T constraints.Ordered](s []T) int
Min returns the index of the minimum value in slice
func MinBy ¶
MinBy finds the minimum value of a slice fn first element greater than the second element returns 1, equality returns 0, and less than -1
func Values ¶
func Values[K comparable, V any](m map[K]V) []V
Values retrieve all the existing values of a map
Types ¶
This section is empty.