diff options
| author | Russ Cox <rsc@golang.org> | 2017-11-14 13:43:02 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2017-11-16 01:08:20 +0000 |
| commit | d0ce197c5835941df6d1d06017c1c34866a13650 (patch) | |
| tree | de78be921974d943779de71d32b0f1ede4843703 /src/database/sql/driver | |
| parent | 734487c929791ab6ea80157ebf958180384fed76 (diff) | |
| download | go-d0ce197c5835941df6d1d06017c1c34866a13650.tar.xz | |
encoding/hex: make Decode, Decoder, DecodeString agree about partial results and errors
CL 70210 added Decoder for #21590, and in doing so it changed
the existing func Decode to return partial results for decoding errors.
That seems like a good change to make to Decode, but it was
untested (except as used by Decoder), inconsistent with DecodeString
in all error cases, and inconsistent with Decoder in not returning
partial results for odd-length input strings.
This CL makes Decode, DecodeString, and Decoder all agree about
the handling of partial results (they are returned) and error
precedence (the error earliest in the input is reported),
and it documents and tests this.
Change-Id: Ifb7d1e100ecb66fe2ed5ba34a621084d480f16db
Reviewed-on: https://go-review.googlesource.com/78120
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/database/sql/driver')
0 files changed, 0 insertions, 0 deletions
