]> Cypherpunks repositories - gostls13.git/commit
fmt: properly handle early io.EOF Reads in readRune.readByte
authorJoe Tsai <joetsai@digital-static.net>
Sat, 16 Jul 2016 09:42:52 +0000 (02:42 -0700)
committerJoe Tsai <thebrokentoaster@gmail.com>
Sat, 16 Jul 2016 19:14:58 +0000 (19:14 +0000)
commit510fb6397dfc93067dc90d42c58dfc5f8b995285
tree426769f014e1b656f24202179e003d22ddf38be7
parent2b6eb276517ecba08985d59b6b1928e29743d3e0
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>
src/fmt/scan.go
src/fmt/scan_test.go