You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Copyright 2020 The Go Authors. All rights reserved.
2
+
// Use of this source code is governed by a BSD-style
3
+
// license that can be found in the LICENSE file.
4
+
5
+
// Tests for the new multiple-key struct tag format supported in 1.16.
6
+
7
+
package go16
8
+
9
+
typeGo16StructTagTeststruct {
10
+
OKint`multiple keys can:"share a value"`
11
+
OK2int`json bson xml form:"field_1,omitempty" other:"value"`
12
+
}
13
+
14
+
typeGo16UnexportedEncodingTagTeststruct {
15
+
Fint`json xml:"ff"`
16
+
17
+
// We currently always check json first, and return after an error.
18
+
f1int`json xml:"f1"`// want "struct field f1 has json tag but is not exported"
19
+
f2int`xml json:"f2"`// want "struct field f2 has json tag but is not exported"
20
+
f3int`xml bson:"f3"`// want "struct field f3 has xml tag but is not exported"
21
+
f4int`bson xml:"f4"`// want "struct field f4 has xml tag but is not exported"
22
+
}
23
+
24
+
typeGo16DuplicateFieldsstruct {
25
+
JSONXMLint`json xml:"c"`
26
+
DuplicateJSONXMLint`json xml:"c"`// want "struct field DuplicateJSONXML repeats json tag .c. also at go16.go:25" "struct field DuplicateJSONXML repeats xml tag .c. also at go16.go:25"
0 commit comments