With Go 1.13 error wrapping was standardised with an interface in the standard library. When properly handling errors, you end up dealing with it a lot. The blog post suggests the following: var e *QueryError if errors.As(err, &e) { // err is a *QueryError, and e is set to the error's value }