diff options
author | Andrew Gerrand <adg@golang.org> | 2014-08-01 11:54:10 +1000 |
---|---|---|
committer | Andrew Gerrand <adg@golang.org> | 2014-08-01 11:54:10 +1000 |
commit | d0554f2511efecc2b7531225c70da926798d7810 (patch) | |
tree | bffd918b8609e6ee0b62a0558c7e0cb065259509 | |
parent | a32484e971937fddcf870056b9a628ee716b1497 (diff) | |
download | go-d0554f2511efecc2b7531225c70da926798d7810.tar.gz |
compress/{gzip,zlib}: mention that Close flushes
Our other CloseFlushers (archive/tar, compress/flate) do mention this.
LGTM=dave, r
R=r, dave
CC=golang-codereviews
https://codereview.appspot.com/117430043
-rw-r--r-- | src/pkg/compress/gzip/gzip.go | 3 | ||||
-rw-r--r-- | src/pkg/compress/zlib/writer.go | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/pkg/compress/gzip/gzip.go b/src/pkg/compress/gzip/gzip.go index 3a0bf54e1..5131d128e 100644 --- a/src/pkg/compress/gzip/gzip.go +++ b/src/pkg/compress/gzip/gzip.go @@ -245,7 +245,8 @@ func (z *Writer) Flush() error { return z.err } -// Close closes the Writer. It does not close the underlying io.Writer. +// Close closes the Writer, flushing any unwritten data to the underlying +// io.Writer, but does not close the underlying io.Writer. func (z *Writer) Close() error { if z.err != nil { return z.err diff --git a/src/pkg/compress/zlib/writer.go b/src/pkg/compress/zlib/writer.go index fac7e15a7..3b4313a8b 100644 --- a/src/pkg/compress/zlib/writer.go +++ b/src/pkg/compress/zlib/writer.go @@ -174,7 +174,8 @@ func (z *Writer) Flush() error { return z.err } -// Calling Close does not close the wrapped io.Writer originally passed to NewWriter. +// Close closes the Writer, flushing any unwritten data to the underlying +// io.Writer, but does not close the underlying io.Writer. func (z *Writer) Close() error { if !z.wroteHeader { z.err = z.writeHeader() |