GCS: FileWriter.Size: include number of buffered bytes if the FileWriter is not closed

Signed-off-by: Arthur Baars <arthur@semmle.com>
This commit is contained in:
Arthur Baars 2016-05-04 21:48:33 +01:00
parent 04ff3c0359
commit 93e3aa9b21
1 changed files with 3 additions and 0 deletions

View File

@ -493,6 +493,9 @@ func (w *writer) Write(p []byte) (int, error) {
// Size returns the number of bytes written to this FileWriter.
func (w *writer) Size() int64 {
if !w.closed {
return w.size + int64(w.buffSize)
}
return w.size
}