• Mark Ryan's avatar
    encoding/base32: ensure base32 decoder propagates errors correctly · 1ea796ee
    Mark Ryan authored
    A number of issues in decoder.Read and newlineFilteringReader.Read were
    preventing errors from the reader supplying the encoded data from being
    propagated to the caller.  Fixing these issues revealed some additional
    problems in which valid decoded data was not always returned to the user
    when errors were actually propagated.
    
    This commit fixes both the error propagation and the lost decoded data
    problems.  It also adds some new unit tests to ensure errors are handled
    correctly by decoder.Read.  The new unit tests increase the test coverage
    of this package from 96.2% to 97.9%.
    
    Fixes #20044
    
    Change-Id: I1a8632da20135906e2d191c2a8825b10e7ecc4c5
    Reviewed-on: https://go-review.googlesource.com/42094Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    1ea796ee
base32_test.go 14.3 KB