-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Description
by joelegasse:
What steps will reproduce the problem? Compiling and running the following program: package main import ( "fmt" "bytes" ) func main() { buf := bytes.NewBuffer([]byte{1, 2, 3, 4, 5}) buf.ReadBytes(3) next,_ := buf.ReadByte() fmt.Println(next) } What is the expected output? "4" should be printed What do you see instead? "1" is printed Which compiler are you using (5g, 6g, 8g, gccgo)? 6g Which operating system are you using? linux Which revision are you using? (hg identify) 867d37fb41a4 release.2011-02-01.1/release Please provide any additional information below. in src/pkg/bytes/buffer.go, right before the return for ReadBytes(), there should be the line: b.off += size