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 { And(v Option[T]) Option[T] AndThen(f func(T) Option[T]) Option[T] Except(v any) T Filter(f func(T) bool) Option[T] IsNone() bool IsSome() bool Map(f func(T) T) Option[T] MapOr(v T, f func(T) T) T MapOrElse(def func() T, next func(T) T) T Or(v Option[T]) Option[T] OrElse(next func() Option[T]) Option[T] Replace(v T) Option[T] Unwrap() T UnwrapOr(v T) T UnwrapOrElse(f func() T) T Value() 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.