]> Cypherpunks repositories - gostls13.git/commit
undo CL 11161044 / ba455262a9db
authorRuss Cox <rsc@golang.org>
Fri, 12 Jul 2013 21:42:01 +0000 (17:42 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 12 Jul 2013 21:42:01 +0000 (17:42 -0400)
commit4419d7e53cba0d897c5962af4ad1dd0b4aaf0b21
tree48024b021b6d0da8d31c4ccbd1867399d5672619
parent64054a40ad0d85e82f77a4982ea4ee08c3cea40a
undo CL 11161044 / ba455262a9db

I want to think more carefully about this.

We put this in because Marshal encoded named []byte but Unmarshal rejected them.
And we noticed that Marshal's behavior was undocumented so we documented it.
But I am starting to think the docs and Unmarshal were correct and Marshal's
behavior was the problem.

Rolling back to give us more time to think.

««« original CL description
json: unmarshal types that are byte slices.

The json package cheerfully would marshal

        type S struct {
                IP net.IP
        }

but would give an error when unmarshalling.  This change allows any
type whose concrete type is a byte slice to be unmarshalled from a
string.

Fixes #5086.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/11161044

»»»

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/11042046
src/pkg/encoding/json/decode.go
src/pkg/encoding/json/decode_test.go
src/pkg/encoding/json/encode.go