Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstNonZero
deprecated
func FirstNonZero[T comparable](values ...T) T
FirstNonZero returns the first argument that is non-zero, or the zero value if all are zero.
Deprecated: Use `cmp.Or` instead. This function will be removed in a near future version.
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 ¶
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.