Source file
test/assign.go
1
2
3
4
5
6
7
8
9
10 package main
11
12 import "sync"
13
14 type T struct {
15 int
16 sync.Mutex
17 }
18
19 func main() {
20 {
21 var x, y sync.Mutex
22 x = y
23 _ = x
24 }
25 {
26 var x, y T
27 x = y
28 _ = x
29 }
30 {
31 var x, y [2]sync.Mutex
32 x = y
33 _ = x
34 }
35 {
36 var x, y [2]T
37 x = y
38 _ = x
39 }
40 {
41 x := sync.Mutex{0, 0}
42 _ = x
43 }
44 {
45 x := sync.Mutex{key: 0}
46 _ = x
47 }
48 {
49 x := &sync.Mutex{}
50 var y sync.Mutex
51 y = *x
52 *x = y
53 _ = x
54 _ = y
55 }
56 {
57 var x = 1
58 {
59 x, x := 2, 3
60 _ = x
61 }
62 _ = x
63 }
64 {
65 a, a := 1, 2
66 _ = a
67 }
68 }
69
View as plain text