linodego
linodego copied to clipboard
feature: Add helper functions for working with errors
📝 Description
This pull request adds two functions to the public API for this package:
-
ErrHasStatus(error, ...int)attempts to unwrap the provided error to an*Errorand see if its status code matches any of the status codes provided. -
IsNotFoundis a thin wrapper overErrHasStatus(err, http.StatusNotFound)for a subjectively-common use case.
Implements #460
✔️ How to Test
make testunit