Help us shape the future of Go! Take the 2026 Go Developer Survey

errors

package
v1.0.27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IdentityError = F.Identity[error]

Functions

func As

func As[A error]() func(error) O.Option[A]

As tries to extract the error of desired type from the given error

func OnError

func OnError(msg string, args ...any) func(error) error

OnError generates a unary function that produces a formatted error. The argument to that function is the root cause of the error and the message will be augmented with a format string containing %w

func OnNone

func OnNone(msg string, args ...any) func() error

OnNone generates a nullary function that produces a formatted error

func OnSome added in v1.0.18

func OnSome[T any](msg string, args ...any) func(T) error

OnSome generates a unary function that produces a formatted error

func ToString added in v1.0.4

func ToString(err error) string

ToString converts an error to a string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL