Releases: aidenwallis/go-utils
Adds mathutil package
Adds mathutil
package.
- Adds
mathutil.Clamp
func - Adds
mathutil.Min
func - Adds
mathutil.Max
func
Adds FirstOf func
Adds a FirstOf
helper which returns the first item in a slice, or the default value.
Adds InvertMap func
Adds InvertMap
- it allows you to invert a given maps keys and values.
Adds localid generator
Adds a localid generator under the localid package.
Adds AnyValueInMap helper
AnyValueInMap
iterates through values and returns true if any has a key in the map.
Adds UniqueSlice helper
UniqueSlice
is a helper function that iterates through your slice and returns a copy with only the unique values. It does this by building a hashmap of all your values and using that to check if it's seen that value before.
Make utils.Ternary parameter type as any
This doesn't need to be comparable, and is limiting how useful this func is. This isn't a breaking change because anything that is comparable is also compatible with any.
Adds PointerNil func
Adds val.PointerNil
to package.
Initial release
Initial release of library