• Joe Tsai's avatar
    compress/flate: deprecate ReadError and WriteError · 2d5601d8
    Joe Tsai authored
    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/14834Reviewed-by: 's avatarNigel Tao <nigeltao@golang.org>
    2d5601d8
flate_test.go 8.99 KB