Documentation ¶
Overview ¶
Package result contains the Of result type, which is either a value or an error.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Of ¶
type Of[T any] struct { // contains filtered or unexported fields }
Of is either a T value or an error.
Think of it like Rust or Swift's result types. It's named "Of" because the fully qualified name for callers reads result.Of[T].
func Error ¶
Error returns a new result with error err. If err is nil, the returned result is equivalent to calling Value with T's zero value.
func (Of[T]) Err ¶
Err returns r's error, if any. When r.Err returns nil, it's safe to call r.MustValue without it panicking.
Click to show internal directories.
Click to hide internal directories.