Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstNonZero ¶
func FirstNonZero[T constraints.Integer | ~string](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 constraints.Integer | string](val, defaultVal T) T
ValOrDefault returns the given value if it's non-zero, and otherwise returns the default.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.