Documentation
¶
Overview ¶
Package optional provides a way to represent optional values in Go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option[T any] interface { Value() T IsNone() bool IsSome() bool Except(v any) T Unwrap() T UnwrapOr(v T) T UnwrapOrElse(f func() T) T And(v Option[T]) Option[T] AndThen(f func(T) Option[T]) Option[T] Or(v Option[T]) Option[T] OrElse(next func() Option[T]) Option[T] Filter(f func(T) bool) Option[T] Map(f func(T) T) Option[T] MapOr(v T, f func(T) T) T MapOrElse(def func() T, next func(T) T) T Replace(v T) Option[T] }
Option is a value that represents the presence of a value or the absence of a value.
Click to show internal directories.
Click to hide internal directories.