go/src/bufio
Martin Garton e51b19a993 bufio: make Reader.Peek invalidate Unreads
Since Reader.Peek potentially reads from the underlying io.Reader,
discarding previous buffers, UnreadRune and UnreadByte cannot
necessarily work.  Change Peek to invalidate the unread buffers in all
cases (as allowed according to the documentation) and thus prevent
hiding bugs in the caller.

(This change was previoiusly merged and then reverted due concern about
being too close to a release)

Fixes #18556

Change-Id: I9027d75aa834d4b27703f37711ba25de04d89f3c
GitHub-Last-Rev: 917ef1e511
GitHub-Pull-Request: golang/go#28768
Reviewed-on: https://go-review.googlesource.com/c/149297
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-11-13 15:08:13 +00:00
..
bufio.go bufio: make Reader.Peek invalidate Unreads 2018-11-13 15:08:13 +00:00
bufio_test.go bufio: make Reader.Peek invalidate Unreads 2018-11-13 15:08:13 +00:00
example_test.go
export_test.go
scan.go bufio: clarify SplitFunc docs for nil token 2018-06-13 21:43:06 +00:00
scan_test.go