Go · Interface
error
Go errors can wrap other errors to add context while preserving the original cause. Use errors.Is and errors.As to inspect the full error chain.
Last updated
- Since
- Go 1.13
Syntax
func (e *QueryError) Unwrap() error
errors.Is(err, target)
errors.As(err, target)
errors.Unwrap(err)
fmt.Errorf("context: %w", err)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
errorUnwraperrors.Iserrors.Aserrors.Unwrapfmt.Errorf