MCPcopy
hub / github.com/pkg/errors / Is

Function Is

go113.go:16–16  ·  view source on GitHub ↗

Is reports whether any error in err's chain matches target. The chain consists of err itself followed by the sequence of errors obtained by repeatedly calling Unwrap. An error is considered to match a target if it is equal to that target or if it implements a method Is(error) bool such that Is(tar

(err, target error)

Source from the content-addressed store, hash-verified

14// An error is considered to match a target if it is equal to that target or if
15// it implements a method Is(error) bool such that Is(target) returns true.
16func Is(err, target error) bool { return stderrors.Is(err, target) }
17
18// As finds the first error in err's chain that matches target, and if so, sets
19// target to that error value and returns true.

Callers 1

TestIsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsFunction · 0.68