Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the a Read assumption #72

Merged
merged 2 commits into from
Mar 8, 2018
Merged

fix the a Read assumption #72

merged 2 commits into from
Mar 8, 2018

Conversation

Stebalien
Copy link
Member

We should succeed in reading the byte even if Read returns an error or an EOF.

Note: We should not be returning this error along with the byte read as that would violate the spec on the ByteReader interface.

We should *succeed* in reading the byte even if Read returns an error or an EOF.

Note: We *should not* be returning this error along with the byte read as that
would violate the spec on the ByteReader interface.
@Stebalien Stebalien requested a review from Kubuxu March 8, 2018 03:18
}
if err == nil {
if n != 0 {
panic("reader returned an invalid length")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this is really needed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, you are checking for a n==1. SGWM.

@Stebalien
Copy link
Member Author

(added a test)

@Stebalien Stebalien mentioned this pull request Mar 8, 2018
9 tasks
@Stebalien Stebalien merged commit 27fa400 into master Mar 8, 2018
@Stebalien Stebalien deleted the fix/read-assumptions branch March 8, 2018 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants