From cba4b416719f7019ecc01a02d8efbf0c9c0e5df9 Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Thu, 1 Jun 2017 17:31:24 -0700 Subject: [PATCH] compress/gzip: clarify behavior of Writer.Close Fixes #20551 Change-Id: Ia47cae14a26fe5f278ad7209218d083cc50a3ff8 Reviewed-on: https://go-review.googlesource.com/44572 Reviewed-by: Ian Lance Taylor --- src/compress/gzip/gzip.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compress/gzip/gzip.go b/src/compress/gzip/gzip.go index aafb442a66..0cc44c59e0 100644 --- a/src/compress/gzip/gzip.go +++ b/src/compress/gzip/gzip.go @@ -222,8 +222,9 @@ func (z *Writer) Flush() error { return z.err } -// Close closes the Writer, flushing any unwritten data to the underlying -// io.Writer, but does not close the underlying io.Writer. +// Close closes the Writer by flushing any unwritten data to the underlying +// io.Writer and writing the GZIP footer. +// It does not close the underlying io.Writer. func (z *Writer) Close() error { if z.err != nil { return z.err -- 2.50.0