Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValOrDefault ¶ added in v0.0.13
func ValOrDefault[T any](ptr *T, defaultVal T) T
ValOrDefault returns the value of the given pointer as long as it's non-nil, and the specified default value otherwise.
func ValOrDefaultFunc ¶ added in v0.0.13
func ValOrDefaultFunc[T any](ptr *T, defaultFunc func() T) T
ValOrDefaultFunc returns the value of the given pointer as long as it's non-nil, or invokes the given function to produce a default value otherwise.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.