MCPcopy Index your code
hub / github.com/go-errors/errors / As

Function As

error_1_13.go:14–16  ·  view source on GitHub ↗

As finds the first error in err's tree that matches target, and if one is found, sets target to that error value and returns true. Otherwise, it returns false. For more information see stdlib errors.As.

(err error, target interface{})

Source from the content-addressed store, hash-verified

12//
13// For more information see stdlib errors.As.
14func As(err error, target interface{}) bool {
15 return baseErrors.As(err, target)
16}
17
18// Is detects whether the error is equal to a given error. Errors
19// are considered equal by this function if they are matched by errors.Is

Callers 1

TestAsFunction · 0.70

Calls

no outgoing calls

Tested by 1

TestAsFunction · 0.56