mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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
This commit is contained in:
parent
288dacd016
commit
48c75c5f9c
4 changed files with 18 additions and 10 deletions
|
|
@ -456,7 +456,7 @@ var allValueIndent = `{
|
|||
"PSlice": null,
|
||||
"PSliceP": null,
|
||||
"EmptySlice": [],
|
||||
"NilSlice": [],
|
||||
"NilSlice": null,
|
||||
"StringSlice": [
|
||||
"str24",
|
||||
"str25",
|
||||
|
|
@ -528,8 +528,8 @@ var pallValueIndent = `{
|
|||
},
|
||||
"EmptyMap": null,
|
||||
"NilMap": null,
|
||||
"Slice": [],
|
||||
"SliceP": [],
|
||||
"Slice": null,
|
||||
"SliceP": null,
|
||||
"PSlice": [
|
||||
{
|
||||
"Tag": "tag20"
|
||||
|
|
@ -547,10 +547,10 @@ var pallValueIndent = `{
|
|||
"Tag": "tag23"
|
||||
}
|
||||
],
|
||||
"EmptySlice": [],
|
||||
"NilSlice": [],
|
||||
"StringSlice": [],
|
||||
"ByteSlice": "",
|
||||
"EmptySlice": null,
|
||||
"NilSlice": null,
|
||||
"StringSlice": null,
|
||||
"ByteSlice": null,
|
||||
"Small": {
|
||||
"Tag": ""
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue