]> Cypherpunks repositories - gostls13.git/commitdiff
bufio: fix rot13Reader bug in test
authorRui Ueyama <ruiu@google.com>
Wed, 30 Jul 2014 00:56:28 +0000 (17:56 -0700)
committerRui Ueyama <ruiu@google.com>
Wed, 30 Jul 2014 00:56:28 +0000 (17:56 -0700)
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/118410043

src/pkg/bufio/bufio_test.go

index 4f3bc1036400d5b9dbc30163cea19e4b0427a377..550dac9173f0083828974c47d8fe3d1acd61eace 100644 (file)
@@ -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