errors: AsType (As with type parameters) · Issue #51945 · golang/go

Currently in 1.18 and before, when using the errors.As method, an error type you would like to write into must be predeclared before calling the function. For example: var myErr *MyCustomError if e...