Source file
test/named1.go
1
2
3
4
5
6
7
8
9
10
11 package main
12
13 type Bool bool
14
15 type Map map[int]int
16
17 func (Map) M() {}
18
19 type Slice []byte
20
21 var slice Slice
22
23 func asBool(Bool) {}
24 func asString(String) {}
25
26 type String string
27
28 func main() {
29 var (
30 b Bool = true
31 i, j int
32 c = make(chan int)
33 m = make(Map)
34 )
35
36 asBool(b)
37 asBool(!b)
38 asBool(true)
39 asBool(*&b)
40 asBool(Bool(true))
41 asBool(1 != 2)
42 asBool(i < j)
43
44 _, b = m[2]
45
46 var inter interface{}
47 _, b = inter.(Map)
48 _ = b
49
50 var minter interface {
51 M()
52 }
53 _, b = minter.(Map)
54 _ = b
55
56 _, bb := <-c
57 asBool(bb)
58 _, b = <-c
59 _ = b
60
61 asString(String(slice))
62 }
63
View as plain text