]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/json: fix comments, tweak tests for tag names
authorMikio Hara <mikioh.mikioh@gmail.com>
Thu, 19 Jan 2012 06:33:29 +0000 (15:33 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Thu, 19 Jan 2012 06:33:29 +0000 (15:33 +0900)
R=bradfitz
CC=golang-dev
https://golang.org/cl/5558047

src/pkg/encoding/json/encode.go
src/pkg/encoding/json/tagkey_test.go

index 042142d2c53d26a492453576f71d5a1a40a95ac3..eac14a47ed7ac1722dfaf595c5ca0ecec0577892 100644 (file)
@@ -79,7 +79,8 @@ import (
 //    Int64String int64 `json:",string"`
 //
 // The key name will be used if it's a non-empty string consisting of
-// only Unicode letters, digits, dollar signs, hyphens, and underscores.
+// only Unicode letters, digits, dollar signs, percent signs, hyphens,
+// underscores and slashes.
 //
 // Map values encode as JSON objects.
 // The map's key type must be string; the object keys are used directly
index 1a15241cb0c3688e16b7777a537b5c2130783438..bba5730353d27f0e26d3cc4f7444da89bdb7a21b 100644 (file)
@@ -9,7 +9,7 @@ import (
 )
 
 type basicLatin2xTag struct {
-       V string `json:"$-"`
+       V string `json:"$%-/"`
 }
 
 type basicLatin3xTag struct {
@@ -53,7 +53,7 @@ type badFormatTag struct {
 }
 
 type badCodeTag struct {
-       Z string `json:" !\"#%&'()*+,./"`
+       Z string `json:" !\"#&'()*+,."`
 }
 
 var structTagObjectKeyTests = []struct {
@@ -61,7 +61,7 @@ var structTagObjectKeyTests = []struct {
        value string
        key   string
 }{
-       {basicLatin2xTag{"2x"}, "2x", "$-"},
+       {basicLatin2xTag{"2x"}, "2x", "$%-/"},
        {basicLatin3xTag{"3x"}, "3x", "0123456789"},
        {basicLatin4xTag{"4x"}, "4x", "ABCDEFGHIJKLMO"},
        {basicLatin5xTag{"5x"}, "5x", "PQRSTUVWXYZ_"},