How to compare Go errors
Declaring an error, and comparing it with ‘==‘ (as in err == myPkg.ErrTokenExpired) is no longer the best practice with Go 1.13 (Q3 2019) The release notes mentions: Go 1.13 contains support for error wrapping, as first proposed in the Error Values proposal and discussed on the associated issue. An error e can wrap another … Read more