diff options
author | Victor Gaydov <victor@enise.org> | 2016-07-12 10:42:39 +0400 |
---|---|---|
committer | Aliaksandr Valialkin <valyala@gmail.com> | 2016-07-12 09:42:39 +0300 |
commit | a0fe3404bf91136124e8416ddabd03998a89e826 (patch) | |
tree | 112975c95c5e1ef3cdf08092c42949bb3a19ddfc /fs.go | |
parent | Implement VisitUserValues - https://github.com/valyala/fasthttp/issues/126 (#... (diff) | |
download | fasthttp-a0fe3404bf91136124e8416ddabd03998a89e826.tar.gz fasthttp-a0fe3404bf91136124e8416ddabd03998a89e826.tar.bz2 fasthttp-a0fe3404bf91136124e8416ddabd03998a89e826.zip |
Add test for fsSmallFileReader.WriteTo and fix bug (#128)
The bug raises when io.Writer passed to fsSmallFileReader.WriteTo
doesn't support ReadFrom interface.
Diffstat (limited to 'fs.go')
-rw-r--r-- | fs.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -593,7 +593,7 @@ func (r *fsSmallFileReader) WriteTo(w io.Writer) (int64, error) { curPos := r.startPos bufv := copyBufPool.Get() buf := bufv.([]byte) - for err != nil { + for err == nil { tailLen := r.endPos - curPos if tailLen <= 0 { break |