Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Optional ¶
type Optional[T any] struct { // Value holds the present value when Set is true, including its type's zero value. Value T // Set distinguishes an absent value from a present zero value. Set bool }
Optional is a simple generic optional type.
See: https://en.wikipedia.org/wiki/Option_type
func EmptyOptional ¶
EmptyOptional returns an absent optional containing the type's zero value.
func OptionalPointer ¶ added in v0.2.1
OptionalPointer copies a non-nil pointed-to value into a present optional; nil produces an absent value.
func OptionalValue ¶ added in v0.2.1
OptionalValue marks value as present, even when it is the zero value.
Click to show internal directories.
Click to hide internal directories.