Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deref ¶
func Deref[T any](t *T) T
Deref returns the value referenced by t if not nil, otherwise the empty value for T is returned.
func DerefWithDefault ¶
func DerefWithDefault[T any](t *T, defaulT T) T
DerefWithDefault returns the value referenced by t if not nil, otherwise defaulT is returned.
func Equal ¶
func Equal[T comparable](a, b *T) bool
Equal returns true if both arguments are nil or both arguments dereference to the same value.
func Overwrite ¶
func Overwrite[T any](dst *T, src T)
Overwrite copies src to dst if: - src is a non-nil channel, function, interface, map, pointer, or slice - src is any other type of value Please note, this function panics if dst is nil.
func OverwriteWithUser ¶
func OverwriteWithUser[T comparable](dst **T, user, current *T)
OverwriteWithUser overwrites the *dst with an optional user value depending on if the value needs to be updated based on the current value.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.