Documentation
¶
Index ¶
- func AllZero[V comparable](vs ...V) bool
- func AllZeroSeq[V comparable](vs iter.Seq[V]) bool
- func AnyZero[V comparable](vs ...V) bool
- func AnyZeroSeq[V comparable](vs iter.Seq[V]) bool
- func IsZero[V comparable](v V) bool
- func OrFunc[V comparable](fs ...func() V) V
- func OrFuncSeq[V comparable](fs iter.Seq[func() V]) V
- func OrSeq[V comparable](vs iter.Seq[V]) V
- func ZeroPredicate[V comparable]() func(v V) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllZero ¶
func AllZero[V comparable](vs ...V) bool
AllZero checks if all the given values are the zero value for their type.
func AllZeroSeq ¶
func AllZeroSeq[V comparable](vs iter.Seq[V]) bool
AllZeroSeq checks if all the given values are the zero value for their type.
func AnyZero ¶
func AnyZero[V comparable](vs ...V) bool
AnyZero checks if any of the given values is the zero value for its type.
func AnyZeroSeq ¶
func AnyZeroSeq[V comparable](vs iter.Seq[V]) bool
AnyZeroSeq checks if any of the given values in the sequence is the zero value for its type.
func IsZero ¶
func IsZero[V comparable](v V) bool
IsZero checks if a value is the zero value for its type.
func OrFunc ¶
func OrFunc[V comparable](fs ...func() V) V
OrFunc is a function-driven alternative of cmp.Or.
func OrFuncSeq ¶
func OrFuncSeq[V comparable](fs iter.Seq[func() V]) V
OrFuncSeq returns the first non-zero value from evaluating the functions in the given sequence. It returns zero if the sequence is empty or if all values are zero.
func OrSeq ¶
func OrSeq[V comparable](vs iter.Seq[V]) V
OrSeq returns the first non-zero value of the given seq. It returns zero if the sequence is empty or if all values are zero.
func ZeroPredicate ¶
func ZeroPredicate[V comparable]() func(v V) bool
ZeroPredicate returns a function that checks if the given value is zero. It only allocates the zero value once.
Types ¶
This section is empty.