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: document the relationship between UnreadByte and Peek #29387

Closed
bcmills opened this issue Dec 21, 2018 · 1 comment
Closed

bufio: document the relationship between UnreadByte and Peek #29387

bcmills opened this issue Dec 21, 2018 · 1 comment

Comments

@bcmills
Copy link
Contributor

bcmills commented Dec 21, 2018

#18556 disallowed calls to (*bufio.Reader).UnreadByte after any Peek, but did not update the documentation for UnreadByte, which currently reads:

UnreadByte unreads the last byte. Only the most recently read byte can be unread.

It is not obvious that Peek changes the meaning of (or invalidates) “the most recently read byte”, so the documentation for UnreadByte should be clarified.

(Or, better still, we should fix UnreadByte so that it works even after a Peek.)

@bcmills bcmills added this to the Go1.12 milestone Dec 21, 2018
@gopherbot
Copy link

Change https://golang.org/cl/155930 mentions this issue: bufio: document relationship between UnreadByte/UnreadRune and Peek

@golang golang locked and limited conversation to collaborators Jan 8, 2020
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