aboutsummaryrefslogtreecommitdiff
path: root/src/compress
diff options
context:
space:
mode:
authorJoe Tsai <joetsai@digital-static.net>2022-09-12 10:15:37 -0700
committerGopher Robot <gobot@golang.org>2022-09-15 20:02:32 +0000
commita29739145d8a46786d503bfc8a8ecf47a7381710 (patch)
treec2e34862915184034a5b5af1aaf7e2b6c83d443b /src/compress
parent44ad662a49e0490af0be12652f64aeab6fe1a5ee (diff)
downloadgo-a29739145d8a46786d503bfc8a8ecf47a7381710.tar.gz
go-a29739145d8a46786d503bfc8a8ecf47a7381710.zip
compress/flate: update NewReader documentation
Calling close is no longer necessary. It was was originally necessary to cleanup goroutines spawned to decompress the stream. This has not been the case since CL 4548079. Update the documentation to mention how it handles trailing data after the end of the DEFLATE stream. Change-Id: Ieacba264230560713b7b8d604665223fd096f4ec Reviewed-on: https://go-review.googlesource.com/c/go/+/430377 Run-TryBot: Joseph Tsai <joetsai@digital-static.net> Auto-Submit: Joseph Tsai <joetsai@digital-static.net> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
Diffstat (limited to 'src/compress')
-rw-r--r--src/compress/flate/inflate.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compress/flate/inflate.go b/src/compress/flate/inflate.go
index 49921398e2..7efd4477ed 100644
--- a/src/compress/flate/inflate.go
+++ b/src/compress/flate/inflate.go
@@ -789,8 +789,8 @@ func (f *decompressor) Reset(r io.Reader, dict []byte) error {
// to read the uncompressed version of r.
// If r does not also implement io.ByteReader,
// the decompressor may read more data than necessary from r.
-// It is the caller's responsibility to call Close on the ReadCloser
-// when finished reading.
+// The reader returns io.EOF after the final block in the DEFLATE stream has
+// been encountered. Any trailing data after the final block is ignored.
//
// The ReadCloser returned by NewReader also implements Resetter.
func NewReader(r io.Reader) io.ReadCloser {