You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
1.8.2
What operating system and processor architecture are you using (go env)?
darwin amd64
What did you do?
When passing an io.Reader to ascii85.NewDecoder, if that reader emits valid ascii85 input and an error, I would expect that error to be propagated. Instead, it is dropped.
This one doesn't actually look like a bug to me. Although the read error is not returned on the initial call to decoder.Read it is saved in d.readErr and neither lost or overwritten. It will be returned on the next call to decoder.Read. This behaviour is compatible with the io.Reader specification.
When Read encounters an error or end-of-file condition after successfully reading n > 0 bytes, it returns the number of bytes read. It may return the (non-nil) error from the same call or return the error (and n == 0) from a subsequent call.
If we insert a second call to decoder.Read directly after the first, e.g.,
n, err := decoder.Read(buf)
+ n, err = decoder.Read(buf)
if err != fakeErr {
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
1.8.2
What operating system and processor architecture are you using (go env)?
darwin amd64
What did you do?
When passing an io.Reader to ascii85.NewDecoder, if that reader emits valid ascii85 input and an error, I would expect that error to be propagated. Instead, it is dropped.
Example: https://play.golang.org/p/b53MrmCtSX
In this case, it's because d.readErr isn't being returned in the branch that handles copying from d.out and then returns.
This is another instance of #20044 .
The text was updated successfully, but these errors were encountered: