errors

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package errors provides error handling utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Walk

func Walk(err error, f WalkFunc)

Walk invokes the given function for each error in the chain. If the provided functions returns true or no further cause can be found, the process is stopped and no further calls will be made.

The next error in the chain is determined by the following rules:

	the return value of this method is used.
  - If the current error has a `Unwrap() error` method
    the return value of this method is used.
  - If the current error has a `Unwrap() []error` method
    the return values of this method is used.
  - Common errors in the Go runtime that contain an Err field will use this value.

Types

type WalkFunc

type WalkFunc func(error) bool

WalkFunc is the signature of the Walk callback function. The function gets the current error in the chain and should return true if the chain processing should be aborted.

Jump to

Keyboard shortcuts

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