]> Cypherpunks repositories - gostls13.git/commitdiff
doc: edit documentation that uses "satisfies reads" and "satisfies writes"
authorBillie Harold Cleek <bhcleek@gmail.com>
Wed, 16 Apr 2014 03:40:47 +0000 (13:40 +1000)
committerAndrew Gerrand <adg@golang.org>
Wed, 16 Apr 2014 03:40:47 +0000 (13:40 +1000)
Make it clear that types that wrap another reader or writer delegate to the wrapped type.

Fixes #7667

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/85720044

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

index fe32d6871ae950985b1775c354745fca73f16048..3a0bf54e1b978bf789713536a032d2b76a65275d 100644 (file)
@@ -22,8 +22,8 @@ const (
        DefaultCompression = flate.DefaultCompression
 )
 
-// A Writer is an io.WriteCloser that satisfies writes by compressing data written
-// to its wrapped io.Writer.
+// A Writer is an io.WriteCloser.
+// Writes to a Writer are compressed and written to w.
 type Writer struct {
        Header
        w           io.Writer
@@ -37,8 +37,8 @@ type Writer struct {
        err         error
 }
 
-// NewWriter creates a new Writer that satisfies writes by compressing data
-// written to w.
+// NewWriter returns a new Writer.
+// Writes to the returned writer are compressed and written to w.
 //
 // It is the caller's responsibility to call Close on the WriteCloser when done.
 // Writes may be buffered and not flushed until Close.
index efbc758f94b8d0b80e1c02d64248eea210563c07..ef596991032f4bb14ed0b7cd60e58e53078d5480 100644 (file)
@@ -216,8 +216,8 @@ func (d *decoder) Close() error {
        return nil
 }
 
-// NewReader creates a new io.ReadCloser that satisfies reads by decompressing
-// the data read from r.
+// NewReader creates a new io.ReadCloser.
+// Reads from the returned io.ReadCloser read and decompress data from r.
 // It is the caller's responsibility to call Close on the ReadCloser when
 // finished reading.
 // The number of bits to use for literal codes, litWidth, must be in the
index b20691864b586d45aac9eba1224e21cd5a89bd16..961b25f94f5fa6d03bcbdd549534548d69486fcb 100644 (file)
@@ -225,8 +225,8 @@ func (e *encoder) Close() error {
        return e.w.Flush()
 }
 
-// NewWriter creates a new io.WriteCloser that satisfies writes by compressing
-// the data and writing it to w.
+// NewWriter creates a new io.WriteCloser.
+// Writes to the returned io.WriteCloser are compressed and written to w.
 // It is the caller's responsibility to call Close on the WriteCloser when
 // finished writing.
 // The number of bits to use for literal codes, litWidth, must be in the
index d54746f4c02418971619ae83cc4a627e3b3b4cbf..9e1aafda9b61e4a9a7a6a4a1d458fc3871275937 100644 (file)
@@ -51,7 +51,8 @@ type reader struct {
        scratch      [4]byte
 }
 
-// NewReader creates a new io.ReadCloser that satisfies reads by decompressing data read from r.
+// NewReader creates a new io.ReadCloser.
+// Reads from the returned io.ReadCloser read and decompress data from r.
 // The implementation buffers input and may read more data than necessary from r.
 // It is the caller's responsibility to call Close on the ReadCloser when done.
 func NewReader(r io.Reader) (io.ReadCloser, error) {
index 99ff6549acb751494fdc9a649cbabb485bc231f2..fac7e15a7e3a04a3f8f33a0e6976a806fa31cd76 100644 (file)
@@ -34,8 +34,8 @@ type Writer struct {
        wroteHeader bool
 }
 
-// NewWriter creates a new Writer that satisfies writes by compressing data
-// written to w.
+// NewWriter creates a new Writer.
+// Writes to the returned Writer are compressed and written to w.
 //
 // It is the caller's responsibility to call Close on the WriteCloser when done.
 // Writes may be buffered and not flushed until Close.