Documentation ¶
Overview ¶
Package ptr provides value to pointer and pointer to value functions.
In most cases, simply use ptr.To or ptr.From functions. There are some extra functions for types which would normally need type conversions from constants, such as ptr.ToInt64.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func From ¶
func From[T any](ref *T) (value T)
From returns the value from a given pointer. If ref is nil, a zero value of type T will be returned.
func FromOrEmpty ¶
func FromOrEmpty[T any](ref *T) (value T)
FromOrEmpty returns the value or empty value in case the value is nil.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.