Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(6)

Issue 1013041: code review 1013041: json: preserve field name case by default (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 11 months ago by rsc
Modified:
14 years, 11 months ago
Reviewers:
CC:
r, golang-dev
Visibility:
Public.

Description

json: preserve field name case by default This matches the old JSON package behavior. All lowercase names are not as standard as I believed, and it seems less surprising to need to write type T struct { Field string "field" } to get lower case (behavior after this CL) than it does to need to write type T struct { Field string "Field" } to preserve the case (behavior before this CL). Also test and fix unmarshal into non-nil interface value or pointer. Fixes issue 744.

Patch Set 1 #

Patch Set 2 : code review 1013041: json: preserve field name case by default #

Patch Set 3 : code review 1013041: json: preserve field name case by default #

Unified diffs Side-by-side diffs Delta from patch set Stats (+164 lines, -127 lines) Patch
M src/pkg/json/decode.go View 1 2 5 chunks +16 lines, -4 lines 0 comments Download
M src/pkg/json/decode_test.go View 1 2 2 chunks +146 lines, -120 lines 0 comments Download
M src/pkg/json/encode.go View 1 2 3 chunks +2 lines, -3 lines 0 comments Download

Messages

Total messages: 3
rsc
Hello r (cc: golang-dev@googlegroups.com), I'd like you to review this change.
14 years, 11 months ago (2010-04-27 05:13:41 UTC) #1
r
LGTM
14 years, 11 months ago (2010-04-27 16:36:23 UTC) #2
rsc
14 years, 11 months ago (2010-04-27 17:24:02 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=2114846f9908 ***

json: preserve field name case by default

This matches the old JSON package behavior.
All lowercase names are not as standard as I believed,
and it seems less surprising to need to write

	type T struct { Field string "field" }

to get lower case (behavior after this CL) than it does to need
to write

	type T struct { Field string "Field" }

to preserve the case (behavior before this CL).

Also test and  fix unmarshal into non-nil interface
value or pointer.

Fixes issue 744.

R=r
CC=golang-dev
http://codereview.appspot.com/1013041
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b