1 // errchk $G -e $D/$F.go
3 // Copyright 2010 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Check line numbers in error messages.
12 _ = x // ERROR "undefined.*x"
13 _ = x // ERROR "undefined.*x"
14 _ = x // ERROR "undefined.*x"
21 func foo() *T { return &T{y: 99} }
22 func bar() int { return y } // ERROR "undefined.*y"
28 func foo1() *T1 { return &T1{y1: 99} }
30 func bar1() int { return y1 }
32 func f1(val interface{}) {
33 switch v := val.(type) {
39 func f2(val interface{}) {
42 println(v) // ERROR "undefined.*v"