1
0
mirror of https://github.com/golang/go synced 2024-09-30 16:08:36 -06:00

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>
This commit is contained in:
Joe Tsai 2022-09-12 10:15:37 -07:00 committed by Gopher Robot
parent 44ad662a49
commit a29739145d

View File

@ -789,8 +789,8 @@ func (f *decompressor) Reset(r io.Reader, dict []byte) error {
// to read the uncompressed version of r. // to read the uncompressed version of r.
// If r does not also implement io.ByteReader, // If r does not also implement io.ByteReader,
// the decompressor may read more data than necessary from r. // the decompressor may read more data than necessary from r.
// It is the caller's responsibility to call Close on the ReadCloser // The reader returns io.EOF after the final block in the DEFLATE stream has
// when finished reading. // been encountered. Any trailing data after the final block is ignored.
// //
// The ReadCloser returned by NewReader also implements Resetter. // The ReadCloser returned by NewReader also implements Resetter.
func NewReader(r io.Reader) io.ReadCloser { func NewReader(r io.Reader) io.ReadCloser {