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

Unified Diff: cmd/vet/testdata/structtag.go

Issue 91010047: code review 91010047: cmd/vet: check for use of json/xml struct tags with une... (Closed)
Patch Set: diff -r 68dc88dd25ff https://code.google.com/p/go.tools Created 9 years, 9 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 | « cmd/vet/structtag.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cmd/vet/testdata/structtag.go
===================================================================
--- a/cmd/vet/testdata/structtag.go
+++ b/cmd/vet/testdata/structtag.go
@@ -11,3 +11,17 @@
type StructTagTest struct {
X int "hello" // ERROR "not compatible with reflect.StructTag.Get"
}
+
+type UnexportedEncodingTagTest struct {
+ x int `json:"xx"` // ERROR "struct field x has json tag but is not exported"
+ y int `xml:"yy"` // ERROR "struct field y has xml tag but is not exported"
+ z int
+ A int `json:"aa" xml:"bb"`
+}
+
+type unexp struct{}
+
+type JSONEmbeddedField struct {
+ UnexportedEncodingTagTest `is:"embedded"`
+ unexp `is:"embedded,notexported" json:"unexp"` // OK for now, see issue 7363
+}
« no previous file with comments | « cmd/vet/structtag.go ('k') | no next file » | no next file with comments »

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