Closed mdlayher closed 3 years ago
If you would be OK with importing an additional package. https://github.com/friendsofgo/errors implements the same Go 1.13+ interface, while being able to use an older version of Go. If later it is decided to drop support for older Go versions, one can just change the import path to the standard error
package. I've seen and done this in other projects already.
If you need help, I can volunteer.
Thanks for reaching out; at this point I'd rather just hold off and drop support for Go 1.12 and below in the next few months. Folks who are running WireGuard are generally more willing to run up to date software since it isn't packaged in any kernels yet.
This is done.
In Go 1.13, we can use
errors.Is(err, os.ErrNotExist)
and similar to look for certain classes of errors. The code in this package should comply with that pattern, while also attempting to retain some compatibility with older versions of Go.