Fix Writers returning n-1 bytes written.

ByteWriter and StringWriter were returning n-1 bytes written which was
causing io.Copy to error out with a ShortWrite. This would cause files
that were larger than the io.Copy internal buffer (32 * 1024) to stop
after the first chunk.
This commit is contained in:
Joseph Hager 2012-07-13 14:57:50 -04:00
parent 98c1704190
commit 93063b64a3
2 changed files with 74 additions and 70 deletions

View File

@ -31,5 +31,7 @@ func (w *ByteWriter) Write(p []byte) (n int, err error) {
w.c++
}
n++
return
}

View File

@ -31,5 +31,7 @@ func (w *StringWriter) Write(p []byte) (n int, err error) {
w.c++
}
n++
return
}