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:
parent
98c1704190
commit
93063b64a3
|
@ -31,5 +31,7 @@ func (w *ByteWriter) Write(p []byte) (n int, err error) {
|
||||||
w.c++
|
w.c++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
n++
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,5 +31,7 @@ func (w *StringWriter) Write(p []byte) (n int, err error) {
|
||||||
w.c++
|
w.c++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
n++
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user