Documentation
¶
Overview ¶
Package lang contains quality-of-life language functions
Index ¶
- func Deref[T any](ref *T) T
- func Identity[T any](item T) T
- func IsEqual[T comparable](value T) func(T) bool
- func IsGreater[T cmp.Ordered](value T) func(T) bool
- func IsGreaterEqual[T cmp.Ordered](value T) func(T) bool
- func IsLesser[T cmp.Ordered](value T) func(T) bool
- func IsLesserEqual[T cmp.Ordered](value T) func(T) bool
- func NotEqual[T comparable](value T) func(T) bool
- func Ref[T any](value T) *T
- func SortAscending[T cmp.Ordered]() func(T, T) int
- func SortDescending[T cmp.Ordered]() func(T, T) int
- func Ternary[T any](condition bool, valueTrue, valueFalse T) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deref ¶
func Deref[T any](ref *T) T
Deref de-references the given item pointer. If null pointer, returns the zero value of the item
func Identity ¶
func Identity[T any](item T) T
Identity returns the passed argument, used as function argument
func IsEqual ¶
func IsEqual[T comparable](value T) func(T) bool
IsEqual returns a function that checks if value is equal to given value, used as function argument
func IsGreater ¶
IsGreater returns a function that checks if value is greater than given value, used as function argument
func IsGreaterEqual ¶
IsGreaterEqual returns a function that checks if value is greater than or equal to given value, used as function argument
func IsLesser ¶
IsLesser returns a function that checks if value is lesser than given value, used as function argument
func IsLesserEqual ¶
IsLesserEqual returns a function that checks if value is lesser than or equal to given value, used as function argument
func NotEqual ¶
func NotEqual[T comparable](value T) func(T) bool
NotEqual returns a function that checks if value is not equal to given value, used as function argument
func SortAscending ¶
SortAscending creates a comparison function for ascending order
func SortDescending ¶
SortDescending creates a comparison function for descending order
Types ¶
This section is empty.