Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Of ¶
func Of[T any](value T) *T
Of returns a pointer to the given value.
This is a convenience function to create a pointer from a value.
Example:
p := ptr.Of(5)
will return a pointer to the value 5.
func ValueOrDefault ¶ added in v0.9.1
func ValueOrDefault[T any](v *T, fallback T) T
ValueOrDefault returns the value of a pointer if it is not nil, or the provided fallback value otherwise.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.