WireGuard / wgctrl-go

Package wgctrl enables control of WireGuard interfaces on multiple platforms.
https://godoc.org/golang.zx2c4.com/wireguard/wgctrl
MIT License
727 stars 85 forks source link

wgctrl: replace "not found" sentinels with errors.Is check #73

Closed mdlayher closed 3 years ago

mdlayher commented 4 years ago

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.

muhlemmer commented 4 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.

mdlayher commented 4 years ago

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.

mdlayher commented 3 years ago

This is done.