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

errs

package
v0.0.59 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As[T error](err error) (T, bool)

As is equivalent to errors.As(), but returns the value in-line.

func IsA

func IsA[T error](err error) bool

IsA indicates whether an error matches an error type.

func IsAErrorMessageContains

func IsAErrorMessageContains[T ErrorWithErrorMessage](err error, needle string) bool

IsAErrorMessageContains returns whether or not the specified error is of the specified type and its ErrorMessage() value contains the specified needle.

func Must

func Must[T any](x T, err error) T

Must is a generic implementation of the Go Must idiom [1, 2]. It panics if the provided error is non-nil and returns x otherwise.

Types

type ErrorWithErrorMessage

type ErrorWithErrorMessage interface {
	error
	// contains filtered or unexported methods
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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