Closed waschik closed 3 years ago
Any news on this one? We also want to be able to use the standard library errors.As()
with errors created with go-errors/errors.Errorf
so this would be very helpful to us.
Thanks for the reminder, and sorry for missing this.
The code change seems reasonable to me, merging!
Starting with go the errors package has an "As" method for getting wrapped errors. In go 1.13 implementation could forward simply to standard package. I tried to implement this also in pre 1.13 with reflection. The merge request contains also two changes caused by running gofmt.
Tested with go1.15.2 and go1.10.4.
PS: I needed this for finding the error type (ErrHelp) in an error for github.com/jessevdk/go-flags