aboutsummaryrefslogtreecommitdiff
path: root/fs.go
diff options
context:
space:
mode:
authorGravatar Victor Gaydov <victor@enise.org> 2016-07-12 10:42:39 +0400
committerGravatar Aliaksandr Valialkin <valyala@gmail.com> 2016-07-12 09:42:39 +0300
commita0fe3404bf91136124e8416ddabd03998a89e826 (patch)
tree112975c95c5e1ef3cdf08092c42949bb3a19ddfc /fs.go
parentImplement VisitUserValues - https://github.com/valyala/fasthttp/issues/126 (#... (diff)
downloadfasthttp-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.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs.go b/fs.go
index 4ea097a..c36073d 100644
--- a/fs.go
+++ b/fs.go
@@ -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