2012-02-17 04:49:30 +00:00
|
|
|
// errorcheck
|
2008-08-20 22:46:05 +00:00
|
|
|
|
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
func f1() {
|
2011-03-15 18:05:07 +00:00
|
|
|
exit:
|
|
|
|
print("hi\n")
|
|
|
|
goto exit
|
2008-08-20 22:46:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func f2() {
|
2011-03-15 18:05:07 +00:00
|
|
|
const c = 1234
|
2008-08-20 22:46:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func f3() {
|
2011-03-15 18:05:07 +00:00
|
|
|
i := c // ERROR "undef"
|
2008-08-20 22:46:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
2011-03-15 18:05:07 +00:00
|
|
|
f3()
|
2008-08-20 22:46:05 +00:00
|
|
|
}
|