diff options
| author | Nodir Turakulov <nodir@google.com> | 2015-10-14 15:18:10 -0700 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2015-10-14 23:29:14 +0000 |
| commit | 07314714c0dc11b690772d3f4c3a582686340961 (patch) | |
| tree | f93141373b92c7133d464391ec257b7d51a79c21 /src/encoding/json/encode_test.go | |
| parent | 20736fcab966412cb41b8a3c9a051469a5c8f00c (diff) | |
| download | go-07314714c0dc11b690772d3f4c3a582686340961.tar.xz | |
encoding/json: simplify encodeState.{string, stringBytes}
As correctly mentioned in #11883, encodeState.string and
encodeState.stringBytes never return an error.
This CL removes the error from the function signatures and somewhat
simplifies call sites.
Fixes #11883
Change-Id: I1d1853d09631c545b68b5eea86ff7daa2e0ca10b
Reviewed-on: https://go-review.googlesource.com/15836
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/encoding/json/encode_test.go')
| -rw-r--r-- | src/encoding/json/encode_test.go | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/encoding/json/encode_test.go b/src/encoding/json/encode_test.go index 7abfa85db7..2206b2ee2e 100644 --- a/src/encoding/json/encode_test.go +++ b/src/encoding/json/encode_test.go @@ -381,16 +381,10 @@ func TestStringBytes(t *testing.T) { r = append(r, i) } s := string(r) + "\xff\xff\xffhello" // some invalid UTF-8 too - _, err := es.string(s) - if err != nil { - t.Fatal(err) - } + es.string(s) esBytes := &encodeState{} - _, err = esBytes.stringBytes([]byte(s)) - if err != nil { - t.Fatal(err) - } + esBytes.stringBytes([]byte(s)) enc := es.Buffer.String() encBytes := esBytes.Buffer.String() |
