]> Cypherpunks repositories - gostls13.git/commit
compress/flate: deprecate ReadError and WriteError
authorJoe Tsai <joetsai@digital-static.net>
Tue, 22 Sep 2015 08:33:11 +0000 (01:33 -0700)
committerNigel Tao <nigeltao@golang.org>
Sat, 10 Oct 2015 00:49:00 +0000 (00:49 +0000)
commit2d5601d85cff9b11acc622833ccefa808e1cdf08
treedbd145b4a142affaed156f59f284dab2d22b89a3
parenta0c7f57903d028790137a4b3ee32b032ac0a56a8
compress/flate: deprecate ReadError and WriteError

A vast majority of the time, ReadError isn't even returned during
IO operations. Instead, an unwrapped error will be returned because
of the ReadByte call on L705. Because DEFLATE streams are primarily
compressed and require byte for byte Huffman decoding, most of the
data read from a data stream will go through ReadByte.

Although this is technically an API change, any user reliant on
this error would not have worked properly anyways due to the fact
that most IO error are not wrapped. We might as well deprecate
ReadError. It is useless and actually makes clients that do
depend on catching IO errors more difficult.

Fixes #11856
Fixes #12724

Change-Id: Ib5fec5ae215e977c4e85de5701ce6a473d400af8
Reviewed-on: https://go-review.googlesource.com/14834
Reviewed-by: Nigel Tao <nigeltao@golang.org>
src/compress/flate/flate_test.go
src/compress/flate/inflate.go