forked from stellar/go-xdr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make encoder/decoder underlying errors unwrappable (stellar#15)
Add `Unwrap` methods to the `MarshalError` and `UnmarshalError` types that return the underlying IO errors if present. The `MarshalError` and `UnmarshalError` error types wrap IO and other errors. Since Go 1.13 if an error provides an `Unwrap` function that returns the underlying error, the `errors` stdlib package can be used to test if the error or any of its underlying errors are an error. This is helpful for testing for general underlying IO errors in code the uses the encoder/decoder as a reader.
- Loading branch information
1 parent
f80a23d
commit b95df30
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters