Documentation ¶
Overview ¶
Package opt defines optional types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bool ¶
type Bool string
Bool represents an optional boolean to be JSON-encoded. The string is either "true", "false", or the empty string to mean unset.
As a special case, the underlying string may also be the string "unset" as as a synonym for the empty string. This lets the explicit unset value be exchanged over an encoding/json "omitempty" field without it being dropped.
func NewBool ¶ added in v1.58.0
NewBool constructs a new Bool value equal to b. The returned Bool is set, unless Set("") or Clear() methods are called.
func (Bool) EqualBool ¶ added in v0.100.0
EqualBool reports whether b is equal to v. If b is empty or not a valid bool, it reports false.
func (Bool) MarshalJSON ¶
func (*Bool) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.