1
0
mirror of https://github.com/golang/go synced 2024-11-21 22:04:39 -07:00

encoding/json: fix comments, tweak tests for tag names

R=bradfitz
CC=golang-dev
https://golang.org/cl/5558047
This commit is contained in:
Mikio Hara 2012-01-19 15:33:29 +09:00
parent 21d3721eb8
commit d4fe9c6a9d
2 changed files with 5 additions and 4 deletions

View 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

View 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_"},