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

bytes: in Buffer, UnreadByte after ReadBytes fails #4583

Closed
rsc opened this issue Dec 21, 2012 · 2 comments
Closed

bytes: in Buffer, UnreadByte after ReadBytes fails #4583

rsc opened this issue Dec 21, 2012 · 2 comments
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Dec 21, 2012

http://play.golang.org/p/foh_Gc09Ls

package main

import (
        "bytes"
        "fmt"
)

func main() {
        var buf bytes.Buffer
        buf.WriteString("abcdefghijklmnopqrstuvwxyz")

        line, err := buf.ReadBytes('m')
    fmt.Printf("%q %v\n", line, err)

        err = buf.UnreadByte()
        if err != nil {
                panic(err)
        }
}

"abcdefghijklm" <nil>
panic: bytes.Buffer: UnreadByte: previous operation was not a read

Reported via email.
@minux
Copy link
Member

minux commented Dec 23, 2012

Comment 1:

started by stephane.travostino
https://golang.org/cl/6976050/

Status changed to Started.

@davecheney
Copy link
Contributor

Comment 2:

This issue was closed by revision 53e342f.

Status changed to Fixed.

@rsc rsc added fixed Suggested Issues that may be good for new contributors looking for work to do. labels Jan 11, 2013
@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

4 participants