]> Cypherpunks repositories - gostls13.git/commitdiff
compress/{gzip,zlib}: mention that Close flushes
authorAndrew Gerrand <adg@golang.org>
Mon, 11 Aug 2014 23:27:39 +0000 (09:27 +1000)
committerAndrew Gerrand <adg@golang.org>
Mon, 11 Aug 2014 23:27:39 +0000 (09:27 +1000)
Our other CloseFlushers (archive/tar, compress/flate) do mention this.

The original change was accidentally submitted to the release branch:
        https://golang.org/cl/117430043/

TBR=rsc
R=r, rsc
CC=golang-codereviews
https://golang.org/cl/124130043

src/pkg/compress/gzip/gzip.go
src/pkg/compress/zlib/writer.go

index 3a0bf54e1b978bf789713536a032d2b76a65275d..5131d128e4e21e348e975d4180b0207878a164dc 100644 (file)
@@ -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
index fac7e15a7e3a04a3f8f33a0e6976a806fa31cd76..3b4313a8beaf56268629dc09664c4a3d3bcc3208 100644 (file)
@@ -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()