Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option[T any] struct { // contains filtered or unexported fields }
Option represents an optional value of type T. It can either be empty (None) or contain a value (Some). When marshaled to JSON, an empty Option becomes `null`.
func (Option[T]) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. An empty Option marshals to literal "null".
func (*Option[T]) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. It correctly handles JSON "null" strings.
Click to show internal directories.
Click to hide internal directories.