Documentation
¶
Overview ¶
Package genericsutil provides helpers for implementing type erasure patterns
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertOrZero ¶
Returns v cast as type T if possible, otherwise returns the zero value of T
func OrDefault ¶
func OrDefault[F comparable](field F, defaultVal F) F
Returns field if it is not the zero value for its type, otherwise returns defaultVal
Types ¶
type AnyZeroHelper ¶
type ZeroHelper ¶
func (ZeroHelper[I, O]) I ¶
func (ZeroHelper[I, O]) I() any
func (ZeroHelper[I, O]) IPtr ¶
func (ZeroHelper[I, O]) IPtr() any
func (ZeroHelper[I, O]) O ¶
func (ZeroHelper[I, O]) O() any
func (ZeroHelper[I, O]) OPtr ¶
func (ZeroHelper[I, O]) OPtr() any
Click to show internal directories.
Click to hide internal directories.