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

bufio: stale documentation on Read, can call underlying reader more than once #12237

Closed
kr opened this issue Aug 20, 2015 · 1 comment
Closed

Comments

@kr
Copy link
Contributor

kr commented Aug 20, 2015

Go version: tip.

The documentation for Read says

It calls Read at most once on the underlying Reader, hence n may be less than len(p).

but Read calls fill, and fill calls the underlying reader up to maxConsecutiveEmptyReads (100) times.

I realize the point of this is actually to say that n may be less than len(p), because Read stops after it gets one block of data (rather than continuing to read more data to fill p, as one might assume). The "no progress" case is unusual, and it generally doesn't matter to the caller, but if the user is supplying the underlying reader, this statement might be misleading.

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Aug 21, 2015
@gopherbot
Copy link

CL https://golang.org/cl/17237 mentions this issue.

@rsc rsc closed this as completed in 829425d Dec 1, 2015
@golang golang locked and limited conversation to collaborators Dec 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants