]> Cypherpunks repositories - gostls13.git/commit
io: clarify the behavior of PipeWriter.CloseWithError(nil).
authorAaron Jacobs <jacobsa@google.com>
Thu, 26 Mar 2015 20:31:31 +0000 (07:31 +1100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 30 Mar 2015 09:43:11 +0000 (09:43 +0000)
commit09b7f4f12a961ed8dad8a37de782f9403e211562
tree43c3b6ffc4eb53015ee5c5c0b7f37efced5c68d5
parentb86f393167a19e9aca1c86eb259396aeae976550
io: clarify the behavior of PipeWriter.CloseWithError(nil).

The previous wording implied that reads would return no error, rather
than EOF. It's convenient for users to know that Close() is equivalent
to CloseWithError(nil) because it can remove a branch from their error
handling code where they want to close the pipe in the appropriate way.
For example:

    https://github.com/jacobsa/gcloud/blob/6e9a8cec0a3f0834da3e9c9725dfe0bf79cccebb/gcs/bucket.go#L637-L643

Change-Id: I618bffe556eb518011e7ba5cdce1eb0ff536350e
Reviewed-on: https://go-review.googlesource.com/8152
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/io/pipe.go