github.com/golangci/go-tools@v0.0.0-20190318060251-af6baa5dc196/unused/testdata/src/embedding/embedding.go (about) 1 package pkg 2 3 type I interface { 4 f1() 5 f2() 6 } 7 8 func init() { 9 var _ I 10 } 11 12 type t1 struct{} 13 type T2 struct{ t1 } 14 15 func (t1) f1() {} 16 func (T2) f2() {} 17 18 func Fn() { 19 var v T2 20 _ = v.t1 21 } 22 23 type I2 interface { 24 f3() 25 f4() 26 } 27 28 type t3 struct{} 29 type t4 struct { 30 x int // MATCH /x is unused/ 31 y int // MATCH /y is unused/ 32 t3 33 } 34 35 func (*t3) f3() {} 36 func (*t4) f4() {} 37 38 func init() { 39 var i I2 = &t4{} 40 i.f3() 41 i.f4() 42 } 43 44 type i3 interface { 45 F() 46 } 47 48 type I4 interface { 49 i3 50 } 51 52 type T5 struct { 53 t6 54 } 55 56 type t6 struct { 57 F int 58 }