-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
tour: rot13Reader hint #12880
Comments
Is it? |
There isn't a problem with the exercise, just my ignorance, but basically if count, err := otherReader.read(myByteBuffer); err{ return 0, err } But when I did that, none of the data was returned. I should have processed The reference docs, that clued me in can be found at: https://golang.org/pkg/io/#Reader Specifically: "Callers should always process the n > 0 bytes returned The bold text above would have prevented me from my original error. I don't Have a good one, and thanks for looking into it! On Tue, Oct 13, 2015 at 4:34 PM, rakyll notifications@github.com wrote:
|
There's an open issue about making the reader example less confusing: #11373 @jonburgin I'm having trouble figuring out what the code looked like that led you to getting a silent failure. Without a clear idea of what went wrong it's difficult to come up with a good explanation that would have helped you avoid it. I'm pretty sure that having |
Yes, err != nil On Wed, Oct 14, 2015 at 2:00 PM, Katrina Owen notifications@github.com
|
Context: http://tour.golang.org/methods/12
Great tutorial!
If I may humbly suggest, it would have helped me to be told that all characters in a reader should be processed even if there is an error. I put a guard statement to not bother to do the rot13 if the enclosed reader returned an error, for efficiency reasons. Although obvious after the fact, I didn't discover the source of my problem until I read the docs on Reader.
The text was updated successfully, but these errors were encountered: