From 93e3aa9b2169edb0e63e5bb33e386a900ee1a82b Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Wed, 4 May 2016 21:48:33 +0100 Subject: [PATCH] GCS: FileWriter.Size: include number of buffered bytes if the FileWriter is not closed Signed-off-by: Arthur Baars --- registry/storage/driver/gcs/gcs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/registry/storage/driver/gcs/gcs.go b/registry/storage/driver/gcs/gcs.go index abe0b9f68..ad5f9bd65 100644 --- a/registry/storage/driver/gcs/gcs.go +++ b/registry/storage/driver/gcs/gcs.go @@ -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 }