Categorygo.bug.st/f
modulepackage
0.4.0
Repository: https://github.com/bugst/go-algorithms.git
Documentation: pkg.go.dev

# Functions

Assert panics if condition is false.
Count returns the number of elements in the input array that match the given matcher.
DiscardCh consumes all incoming messages from the given channel until it's closed.
Equals return a Matcher that matches the given value.
Filter takes a slice of type []T and a Matcher[T].
Map applies the Mapper function to each element of the slice and returns a new slice with the results in the same order.
Must should be used to wrap a call to a function returning a value and an error.
NotEquals return a Matcher that does not match the given value.
ParallelMap applies the Mapper function to each element of the slice and returns a new slice with the results in the same order.
Ptr returns a pointer to v.
Reduce applies the Reducer function to all elements of the input values and returns the result.
Uniq return a copy of the input array with all duplicates removed.
UnwrapOrDefault returns the ptr value if it is not nil, otherwise returns the zero value.

# Structs

Future is an object that holds a result value.

# Type aliases

Mapper is a function that converts a value of one type to another type.
Matcher is a function that tests if a given value matches a certain criteria.
Reducer is a function that combines two values of the same type and return the combined value.