-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
os: improve file.Read method description #6639
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Comments
This could be clarified, but your sentence "The buffer will not be truncated." doesn't make much since, since the caller owns the slice. The File.Read method doesn't get a pointer to the slice, so it wouldn't even be possible for the Read method to truncate it. For reference, the io.Reader docs are more clear: http://tip.golang.org/pkg/io/#Reader What's not clear is whether the File.Read docs are trying to promise a tighter contract than io.Reader.Read itself. Labels changed: added documentation. |
Good point on the buffer. You are right, that clarification is unnecessary. The io.Reader description is better. Perhaps file could link to that description and explicitly state the fact that no io.EOF error is returned when n > 0 (the io description specifies that either may happen). Perhaps this should be a different issue, but I'm confused by " and callers should treat that situation as a no-op" that is the last sentence of the io.Reader description. Is that just saying there should be a check like if bytesLeftInReader == 0{ return 0, io.EOF } ? |
CL https://golang.org/cl/22220 mentions this issue. |
quentinmit
added
the
NeedsFix
The path to resolution is known, but the work has not been done.
label
Oct 10, 2016
CL https://golang.org/cl/32102 mentions this issue. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
The text was updated successfully, but these errors were encountered: