Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
d4fe9c6a
Commit
d4fe9c6a
authored
Jan 19, 2012
by
Mikio Hara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
encoding/json: fix comments, tweak tests for tag names
R=bradfitz CC=golang-dev
https://golang.org/cl/5558047
parent
21d3721e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
encode.go
src/pkg/encoding/json/encode.go
+2
-1
tagkey_test.go
src/pkg/encoding/json/tagkey_test.go
+3
-3
No files found.
src/pkg/encoding/json/encode.go
View file @
d4fe9c6a
...
...
@@ -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
...
...
src/pkg/encoding/json/tagkey_test.go
View file @
d4fe9c6a
...
...
@@ -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_"
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment