1
2
3
4
5
6
7
8
9
10 package main
11
12 type T int
13
14 func (t T) V()
15 func (t *T) P()
16
17 type V interface {
18 V()
19 }
20 type P interface {
21 P()
22 V()
23 }
24
25 type S struct {
26 T
27 }
28 type SP struct {
29 *T
30 }
31
32 func main() {
33 var t T
34 var v V
35 var p P
36 var s S
37 var sp SP
38
39 v = t
40 p = t
41 _, _ = v, p
42 v = &t
43 p = &t
44 _, _ = v, p
45
46 v = s
47 p = s
48 _, _ = v, p
49 v = &s
50 p = &s
51 _, _ = v, p
52
53 v = sp
54 p = sp
55 _, _ = v, p
56 v = &sp
57 p = &sp
58 _, _ = v, p
59 }
60
View as plain text