xcmp

package
v0.0.0-...-c0326d0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL