Documentation
¶
Overview ¶
Package options provides additional functions for type option.Option that cannot be expressed as methods on the Option type itself.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromPointer ¶
func FromPointer[T any](value *T) Option[T]
FromPointer converts a *T into an Option[T].
func IsNoneOrZero ¶
func IsNoneOrZero[T comparable](o Option[T]) bool
IsNoneOrZero returns whether o is either empty, or contains a zero value.
func Map ¶
func Map[T, U any](o Option[T], mapping func(T) U) Option[U]
Map applies the given function to the value contained in o, if there is one.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.