1
2
3
4
5
6
7 package decls1
8
9 import (
10 "math"
11 )
12
13
14 var (
15 a, b bool
16 c byte
17 d uint8
18 r rune
19 i int
20 j, k, l int
21 x, y float32
22 xx, yy float64
23 u, v complex64
24 uu, vv complex128
25 s, t string
26 array []byte
27 iface interface{}
28
29 blank _
30 )
31
32
33 var (
34 s1 = i + j
35 s2 = i + x
36 s3 = c + d
37 s4 = s + t
38 s5 = s / t
39 s6 = array[t1]
40 s7 = array[x ]
41 s8 = &a
42 s10 = &42
43 s11 = &v
44 s12 = -(u + *t11) / *&v
45 s13 = a << d
46 s14 = i << j
47 s18 = math.Pi * 10.0
48 s19 = s1 ()
49 s20 = f0 ()
50 s21 = f6(1, s1, i)
51 s22 = f6(1, s1, uu )
52
53 t1 int = i + j
54 t2 int = i + x
55 t3 int = c + d
56 t4 string = s + t
57 t5 string = s / t
58 t6 byte = array[t1]
59 t7 byte = array[x ]
60 t8 *int = & a
61 t10 *int = &42
62 t11 *complex64 = &v
63 t12 complex64 = -(u + *t11) / *&v
64 t13 int = a << d
65 t14 int = i << j
66 t15 math
67 t16 math.xxx
68 t17 math .Pi
69 t18 float64 = math.Pi * 10.0
70 t19 int = t1 ()
71 t20 int = f0 ()
72 t21 int = a
73 )
74
75
76 var (
77 u1 = x .(int)
78 u2 = iface.([]int)
79 u3 = iface.(a )
80 u4, ok = iface.(int)
81 u5, ok2, ok3 = iface .(int)
82 )
83
84
85 var (
86 v1 = 1 + "foo"
87 v2 = c + 255
88 v3 = c + 256
89 v4 = r + 2147483647
90 v5 = r + 2147483648
91 v6 = 42
92 v7 = v6 + 9223372036854775807
93 v8 = v6 + 9223372036854775808
94 v9 = i + 1 << 10
95 v10 byte = 1024
96 v11 = xx/yy*yy - xx
97 v12 = true && false
98 v13 = nil
99 v14 string = 257
100 v15 int8 = 257
101 )
102
103
104 var (
105 m1a, m1b = 1, 2
106 m2a, m2b, m2c = 1, 2
107 m3a, m3b = 1, 2, 3
108 )
109
110 func _() {
111 var (
112 m1a, m1b = 1, 2
113 m2a, m2b, m2c = 1, 2
114 m3a, m3b = 1, 2, 3
115 )
116
117 _, _ = m1a, m1b
118 _, _, _ = m2a, m2b, m2c
119 _, _ = m3a, m3b
120 }
121
122
123 func f0() {}
124 func f1(a ) {}
125 func f2(a, b, c d ) {}
126
127 func f3() int { return 0 }
128 func f4() a { return 0 }
129 func f5() (a, b, c d ) { return }
130
131 func f6(a, b, c int) complex128 { return 0 }
132
133
134 type T struct{}
135
136 func (T) m0() {}
137 func (*T) m1() {}
138 func (x T) m2() {}
139 func (x *T) m3() {}
140
141
142 func init() {}
143 func init (int) {}
144 func init () int { return 0 }
145 func init (int) int { return 0 }
146 func (T) init(int) int { return 0 }
147
View as plain text