package
Version:
v0.3.0
Opens a new window with list of versions in this module.
Published: Apr 29, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
BoolSome returns an Bool with the given value set.
Get returns the stored value and a boolean indicating whether it is set.
IsSet reports whether the Option contains a value.
MustGet returns the stored value or panics if no value is set.
Or returns the stored value if set, otherwise returns the provided default.
Set assigns a value and marks the Option as set.
Unset clears the value and marks the Option as not set.
type Option[T any] struct {
}
Option represents a value that may or may not be present.
From constructs an Option from a value and a presence flag.
None returns an empty Option with no value set.
Some returns an Option with the given value set.
Get returns the stored value and a boolean indicating whether it is set.
IsSet reports whether the Option contains a value.
func (o Option[T]) MustGet() T
MustGet returns the stored value or panics if no value is set.
func (o Option[T]) Or(def T) T
Or returns the stored value if set, otherwise returns the provided default.
Set assigns a value and marks the Option as set.
Unset clears the value and marks the Option as not set.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.