Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meta: fix issue with errors.WithStack, io.Copy expect io.EOF
We cannot use errors.WithStack [1] to maintain call stack information of zeros.Read as this method is invoked from io.Copy (in verifyPadding) which expects io.EOF. Note, the type of the returned error in the case of EOF becomes, "errors.withStack" with the concrete value: errors.withStack{error: io.EOF, stack: callers()} This broke the tests: https://travis-ci.org/mewkiz/flac/builds/383805346#L540 We cannot update the standard library to check for io.EOF using errors.Cause(err) == io.EOF. Thus, this seems like the only solution. Unfortunate, and a bit scare, as there may be other use of interfaces which break since the error returned is wrapped with added context. Hope this gets resolved in Go 2. I know @bradfitz among others have raised their interest in finding ways to improve and further simplify error handling mechanisms [2]. [1]: https://github.com/pkg/errors [2]: https://github.com/golang/go/wiki/Go2 Updates #22. Related to golang/go#21161.
- Loading branch information