Source file
test/undef.go
1
2
3
4
5
6
7
8
9
10 package main
11
12 var (
13 _ = x
14 _ = x
15 _ = x
16 )
17
18 type T struct {
19 y int
20 }
21
22 func foo() *T { return &T{y: 99} }
23 func bar() int { return y }
24
25 type T1 struct {
26 y1 int
27 }
28
29 func foo1() *T1 { return &T1{y1: 99} }
30 var y1 = 2
31 func bar1() int { return y1 }
32
33 func f1(val interface{}) {
34 switch v := val.(type) {
35 default:
36 println(v)
37 }
38 }
39
40 func f2(val interface{}) {
41 switch val.(type) {
42 default:
43 println(v)
44 }
45 }
46
View as plain text