From 431e46a7f9a5dd7f8ebd13af44c91ae887d4af06 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Mon, 9 May 2016 15:39:46 +0100 Subject: [PATCH] GCS: FileWriter.Size: return offset + buffer size for Writers that are not closed Signed-off-by: Arthur Baars --- registry/storage/driver/gcs/gcs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/storage/driver/gcs/gcs.go b/registry/storage/driver/gcs/gcs.go index ad5f9bd65..2aad7faa9 100644 --- a/registry/storage/driver/gcs/gcs.go +++ b/registry/storage/driver/gcs/gcs.go @@ -494,7 +494,7 @@ 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.offset + int64(w.buffSize) } return w.size }