Documentation
¶
Overview ¶
Package errors provides helpers for working with errors.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAny ¶
IsAny reports whether any error in `targets` matches `err`'s error tree. Each target is compared using errors.Is.
Example ¶
package main
import (
"errors"
"fmt"
xerrors "github.com/gechr/x/errors"
)
func main() {
errNotFound := errors.New("not found")
errUnavailable := errors.New("unavailable")
err := fmt.Errorf("lookup: %w", errNotFound)
fmt.Println(xerrors.IsAny(err, errNotFound, errUnavailable))
}
Output: true
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.