]> Cypherpunks repositories - gostls13.git/commit
json: Properly handle nil slices.
authorAlexander Reece <awreece@gmail.com>
Mon, 31 Oct 2011 17:59:23 +0000 (13:59 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 31 Oct 2011 17:59:23 +0000 (13:59 -0400)
commit48c75c5f9c8e97b87fbd8f24dffa73d6b2148691
tree0429c746670b4e7428d65c52fb1a9f868e1880e3
parent288dacd016e549a9524b776e9a56cbab3a50fb3a
json: Properly handle nil slices.

Marshal nil slices as null and parse null value as a nil slice.
Fixes #2278.

R=rsc
CC=golang-dev
https://golang.org/cl/5257053
src/pkg/json/decode.go
src/pkg/json/decode_test.go
src/pkg/json/encode.go
src/pkg/json/encode_test.go