Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / staticcheck / testdata / src / CheckStructTags / CheckStructTags.go
1 package pkg
2
3 import _ "github.com/jessevdk/go-flags"
4
5 type T1 struct {
6         B int        `foo:"" foo:""` // want `duplicate struct tag`
7         C int        `foo:"" bar:""`
8         D int        `json:"-"`
9         E int        `json:"\\"`                   // want `invalid JSON field name`
10         F int        `json:",omitempty,omitempty"` // want `duplicate JSON option "omitempty"`
11         G int        `json:",omitempty,string"`
12         H int        `json:",string,omitempty,string"` // want `duplicate JSON option "string"`
13         I int        `json:",unknown"`                 // want `unknown JSON option "unknown"`
14         J int        `json:",string"`
15         K *int       `json:",string"`
16         L **int      `json:",string"` // want `the JSON string option`
17         M complex128 `json:",string"` // want `the JSON string option`
18         N int        `json:"some-name"`
19         O int        `json:"some-name,inline"`
20 }
21
22 type T2 struct {
23         A int `xml:",attr"`
24         B int `xml:",chardata"`
25         C int `xml:",cdata"`
26         D int `xml:",innerxml"`
27         E int `xml:",comment"`
28         F int `xml:",omitempty"`
29         G int `xml:",any"`
30         H int `xml:",unknown"` // want `unknown XML option`
31         I int `xml:",any,any"` // want `duplicate XML option`
32         J int `xml:"a>b>c,"`
33         K int `xml:",attr,cdata"` // want `mutually exclusive`
34 }
35
36 type T3 struct {
37         A int `json:",omitempty" xml:",attr"`
38         B int `json:",unknown" xml:",attr"` // want `unknown JSON option`
39 }
40
41 type T4 struct {
42         A int   `choice:"foo" choice:"bar"`
43         B []int `optional-value:"foo" optional-value:"bar"`
44         C []int `default:"foo" default:"bar"`
45         D int   `json:"foo" json:"bar"` // want `duplicate struct tag`
46 }