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: UnreadByte can unread more than one byte #7607

Closed
rui314 opened this issue Mar 22, 2014 · 4 comments
Closed

bufio: UnreadByte can unread more than one byte #7607

rui314 opened this issue Mar 22, 2014 · 4 comments
Milestone

Comments

@rui314
Copy link
Member

rui314 commented Mar 22, 2014

What does 'go version' print?
go version devel +2b85dda01af0 Wed Mar 19 10:14:04 2014 -0700 linux/amd64

What steps reproduce the problem?
http://play.golang.org/p/S97IegN_jI

UnreadByte can be called any number of times without error until it reaches beginning of
the internal buffer, despite it's documentation says "only the most recently read
byte can be unread."

I'm not sure if it's an undefined behavior or a bug, so I'm just filing it.
@griesemer
Copy link
Contributor

Comment 1:

Labels changed: added release-go1.3maybe, repo-main.

Owner changed to @griesemer.

Status changed to Accepted.

@griesemer
Copy link
Contributor

Comment 2:

The documentation should say that only unreading of the most recently read byte is
guaranteed. That said, exactly when it's possible to unread more bytes depends on a
various factors and is not easily predictable in general. Changed code to follow the
documentation and added test:
https://golang.org/cl/86180043/

Status changed to Started.

@gopherbot
Copy link

Comment 3:

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

@griesemer
Copy link
Contributor

Comment 4:

This issue was closed by revision 8bd9242.

Status changed to Fixed.

@rsc rsc added this to the Go1.3 milestone 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
Development

No branches or pull requests

4 participants