Go · Function
errors.As
errors.As checks whether an error or one of its wrapped errors has a requested type. It stores the matching error in a target variable when it finds one.
Last updated
- Since
- Go 1.13
Syntax
func As(err error, target any) boolIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
errors.Iserrors.Unwrapfmt.ErrorfUnwrap