@@ -15,6 +15,8 @@ type StructTagTest struct {
15
15
F int `:"emptykey"` // ERROR "not compatible with reflect.StructTag.Get: bad syntax for struct tag key"
16
16
G int `x:"noEndQuote` // ERROR "not compatible with reflect.StructTag.Get: bad syntax for struct tag value"
17
17
H int `x:"trunc\x0"` // ERROR "not compatible with reflect.StructTag.Get: bad syntax for struct tag value"
18
+ I int `x:"foo",y:"bar"` // ERROR "not compatible with reflect.StructTag.Get: key:.value. pairs not separated by spaces"
19
+ J int `x:"foo"y:"bar"` // ERROR "not compatible with reflect.StructTag.Get: key:.value. pairs not separated by spaces"
18
20
OK0 int `x:"y" u:"v" w:""`
19
21
OK1 int `x:"y:z" u:"v" w:""` // note multiple colons.
20
22
OK2 int "k0:\" values contain spaces\" k1:\" literal\t tabs\" k2:\" and\\ tescaped\\ tabs\" "
@@ -37,25 +39,25 @@ type JSONEmbeddedField struct {
37
39
38
40
type DuplicateJSONFields struct {
39
41
JSON int `json:"a"`
40
- DuplicateJSON int `json:"a"` // ERROR "struct field DuplicateJSON repeats json tag .a. also at testdata/structtag.go:39 "
42
+ DuplicateJSON int `json:"a"` // ERROR "struct field DuplicateJSON repeats json tag .a. also at testdata/structtag.go:41 "
41
43
IgnoredJSON int `json:"-"`
42
44
OtherIgnoredJSON int `json:"-"`
43
45
OmitJSON int `json:",omitempty"`
44
46
OtherOmitJSON int `json:",omitempty"`
45
- DuplicateOmitJSON int `json:"a,omitempty"` // ERROR "struct field DuplicateOmitJSON repeats json tag .a. also at testdata/structtag.go:39 "
47
+ DuplicateOmitJSON int `json:"a,omitempty"` // ERROR "struct field DuplicateOmitJSON repeats json tag .a. also at testdata/structtag.go:41 "
46
48
NonJSON int `foo:"a"`
47
49
DuplicateNonJSON int `foo:"a"`
48
50
Embedded struct {
49
51
DuplicateJSON int `json:"a"` // OK because its not in the same struct type
50
52
}
51
53
52
54
XML int `xml:"a"`
53
- DuplicateXML int `xml:"a"` // ERROR "struct field DuplicateXML repeats xml tag .a. also at testdata/structtag.go:52 "
55
+ DuplicateXML int `xml:"a"` // ERROR "struct field DuplicateXML repeats xml tag .a. also at testdata/structtag.go:54 "
54
56
IgnoredXML int `xml:"-"`
55
57
OtherIgnoredXML int `xml:"-"`
56
58
OmitXML int `xml:",omitempty"`
57
59
OtherOmitXML int `xml:",omitempty"`
58
- DuplicateOmitXML int `xml:"a,omitempty"` // ERROR "struct field DuplicateOmitXML repeats xml tag .a. also at testdata/structtag.go:52 "
60
+ DuplicateOmitXML int `xml:"a,omitempty"` // ERROR "struct field DuplicateOmitXML repeats xml tag .a. also at testdata/structtag.go:54 "
59
61
NonXML int `foo:"a"`
60
62
DuplicateNonXML int `foo:"a"`
61
63
Embedded struct {
0 commit comments