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