Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶ added in v0.11.0
type Interface[T any] interface { // Set the optional value Set(T) // Get the optional value, IsNil() MUST be checked before calling this method Get() T // Erase the optional value, after calling this, IsNil() will return true // until Set(T) is called. Erase() bool // IsNil returns true when there is no optional value IsNil() bool }
Interface defines the interface of an optional value
type Value ¶
type Value[T any] struct { V T // contains filtered or unexported fields }
func NonNilValue ¶ added in v0.12.0
func (*Value[T]) Get ¶
func (o *Value[T]) Get() T
Get implements Interface, it panics when Value[T] is nil
Click to show internal directories.
Click to hide internal directories.