aboutsummaryrefslogtreecommitdiff
path: root/src/pkg
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2014-07-29 17:56:28 -0700
committerRui Ueyama <ruiu@google.com>2014-07-29 17:56:28 -0700
commita219ff25c6b1b8b57fc93947ebe691dc23a408f7 (patch)
tree5ca5fd56a289e1a907f823190b86dc5f1b4efd3e /src/pkg
parented963c908d11fc6ffd17c9e9bc615cc134af6046 (diff)
downloadgo-a219ff25c6b1b8b57fc93947ebe691dc23a408f7.tar.xz
bufio: fix rot13Reader bug in test
LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/118410043
Diffstat (limited to 'src/pkg')
-rw-r--r--src/pkg/bufio/bufio_test.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/pkg/bufio/bufio_test.go b/src/pkg/bufio/bufio_test.go
index 4f3bc10364..550dac9173 100644
--- a/src/pkg/bufio/bufio_test.go
+++ b/src/pkg/bufio/bufio_test.go
@@ -31,9 +31,6 @@ func newRot13Reader(r io.Reader) *rot13Reader {
func (r13 *rot13Reader) Read(p []byte) (int, error) {
n, err := r13.r.Read(p)
- if err != nil {
- return n, err
- }
for i := 0; i < n; i++ {
c := p[i] | 0x20 // lowercase byte
if 'a' <= c && c <= 'm' {
@@ -42,7 +39,7 @@ func (r13 *rot13Reader) Read(p []byte) (int, error) {
p[i] -= 13
}
}
- return n, nil
+ return n, err
}
// Call ReadByte to accumulate the text of a file