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

Unified Diff: src/pkg/json/decode_test.go

Issue 4645069: code review 4645069: reflect: support for struct tag use by multiple packages (Closed)
Patch Set: diff -r dd7479dd252a https://go.googlecode.com/hg/ Created 13 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/json/decode.go ('k') | src/pkg/json/encode.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/json/decode_test.go
===================================================================
--- a/src/pkg/json/decode_test.go
+++ b/src/pkg/json/decode_test.go
@@ -42,8 +42,9 @@
type badTag struct {
X string
- Y string "y"
- Z string "@#*%(#@"
+ Y string `json:"y"`
+ Z string `x:"@#*%(#@"`
+ W string `json:"@#$@#$"`
}
type unmarshalTest struct {
@@ -68,7 +69,7 @@
{`{"x": 1}`, new(tx), tx{}, &UnmarshalFieldError{"x", txType, txType.Field(0)}},
// skip invalid tags
- {`{"X":"a", "y":"b", "Z":"c"}`, new(badTag), badTag{"a", "b", "c"}, nil},
+ {`{"X":"a", "y":"b", "Z":"c", "W":"d"}`, new(badTag), badTag{"a", "b", "c", "d"}, nil},
// syntax errors
{`{"X": "foo", "Y"}`, nil, nil, &SyntaxError{"invalid character '}' after object key", 17}},
@@ -250,7 +251,7 @@
Float32 float32
Float64 float64
- Foo string "bar"
+ Foo string `json:"bar"`
PBool *bool
PInt *int
« no previous file with comments | « src/pkg/json/decode.go ('k') | src/pkg/json/encode.go » ('j') | no next file with comments »

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