Skip to content

bufio: document the relationship between UnreadByte and Peek #29387

@bcmills

Description

@bcmills

#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.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions