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

encoding/gob: document that Decode returns io.EOF at end of input #7033

Closed
gopherbot opened this issue Dec 30, 2013 · 4 comments
Closed

encoding/gob: document that Decode returns io.EOF at end of input #7033

gopherbot opened this issue Dec 30, 2013 · 4 comments
Assignees
Milestone

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Dec 30, 2013

by kkowalczyk:

Docs for gob.Decoder.Decode() should mention that io.EOF is returned when there's
nothing more to decode. One of the examples could be extended to show how to handle that
properly. Due to lack of this information, I had to write a test program to understand
the behavior.
@robpike
Copy link
Contributor

@robpike robpike commented Dec 30, 2013

Comment 1:

I'm surprised you find "EOF at end of input" surprising. Can you please explain better
what confused you?
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Dec 31, 2013

Comment 2 by kkowalczyk:

I don't find it surprising. If you feel like being condescending, then at least be
factually correct wrt what I wrote.
The behavior is perfectly logical once you know it but when I didn't know it, it wasn't
obvious. Obviously.
I don't have an explanation for my confusion. I know that I did experience it.
Maybe I'm dumb.
Or maybe you can't expect people to make mental connections between an EOF constant in
io package and error returned from Decode(). Documentation is not meant to be a puzzle.
@rsc
Copy link
Contributor

@rsc rsc commented Mar 3, 2014

Comment 3:

FWIW, I agree that it's nice to be explicit about what can be expected. It's not that
"EOF at end of input" is surprising, it's that unless that fact is documented, you might
not want to rely on it.

Labels changed: added release-go1.3maybe.

Owner changed to @robpike.

Status changed to Accepted.

@robpike
Copy link
Contributor

@robpike robpike commented Mar 7, 2014

Comment 4:

This issue was closed by revision 22c668a.

Status changed to Fixed.

@gopherbot gopherbot added fixed labels Mar 7, 2014
@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.