1
0
mirror of https://github.com/golang/go synced 2024-10-04 09:31:22 -06:00
go/src/fmt
Joe Tsai 510fb6397d fmt: properly handle early io.EOF Reads in readRune.readByte
Change https://golang.org/cl/19895 caused a regression
where the last character in a string would be dropped if it was
accompanied by an io.EOF.

This change fixes the logic so that the last byte is still returned
without a problem.

Fixes #16393

Change-Id: I7a4d0abf761c2c15454136a79e065fe002d736ea
Reviewed-on: https://go-review.googlesource.com/24981
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-07-16 19:14:58 +00:00
..
doc.go fmt: remove extra space in too few arguments example 2016-05-12 20:45:48 +00:00
export_test.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
fmt_test.go fmt: fix padding when precision is set for integer formatting 2016-04-17 16:23:12 +00:00
format.go fmt: fix padding when precision is set for integer formatting 2016-04-17 16:23:12 +00:00
print.go fmt: optimize struct layout and intbuf size 2016-04-15 19:28:41 +00:00
scan_test.go fmt: properly handle early io.EOF Reads in readRune.readByte 2016-07-16 19:14:58 +00:00
scan.go fmt: properly handle early io.EOF Reads in readRune.readByte 2016-07-16 19:14:58 +00:00
stringer_test.go