1 // Test of field usage detection
5 type t1 struct{ f11, f12 int }
6 type t2 struct{ f21, f22 int }
7 type t3 struct{ f31 t4 }
8 type t4 struct{ f41 int }
9 type t5 struct{ f51 int }
10 type t6 struct{ f61 int }
11 type t7 struct{ f71 int }
13 type t8 struct{ f81 int }
14 type t9 struct{ f91 int }
15 type t10 struct{ f101 int }
16 type t11 struct{ f111 int }
18 type t12 struct{ f121 int }
20 type t13 struct{ f131 int }
21 type t14 struct{ f141 int }
23 type t15 struct{ f151 int }
25 type t16 struct{ f161 int }
26 type t17 struct{ f171, f172 int } // want `t17`
27 type t18 struct{ f181, f182, f183 int } // want `f182` `f183`
29 type t19 struct{ f191 int }
30 type m2 map[string]t19
32 type t20 struct{ f201 int }
33 type m3 map[string]t20
35 type t21 struct{ f211, f212 int } // want `f211`
42 _ = []struct{ a int }{{1}}
45 // _ = []struct{ foo struct{ bar int } }{{struct{ bar int }{1}}}
49 _ = map[string]t5{"a": {1}}
50 _ = map[t6]string{{1}: "a"}
52 _ = map[t8]t8{{}: {1}}
53 _ = map[t9]t9{{1}: {}}
59 _ = map[[1]t16]int{{{1}}: 1}
60 y := struct{ x int }{}
64 _ = [][]m3{{{"a": {1}}}}