Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstNonZero ¶
func FirstNonZero[T comparable](values ...T) T
FirstNonZero returns the first argument that is non-zero, or the zero value if all are zero.
func ValOrDefault ¶
func ValOrDefault[T comparable](val, defaultVal T) T
ValOrDefault returns the given value if it's non-zero, and otherwise returns the default.
func ValOrDefaultFunc ¶ added in v0.1.0
func ValOrDefaultFunc[T comparable](val T, defaultFunc func() T) T
ValOrDefault returns the given value if it's non-zero, and otherwise invokes defaultFunc to produce a default value.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.