2012-02-16 21:49:30 -07:00
|
|
|
// errorcheck
|
2008-08-20 16:46:05 -06: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 12:05:07 -06:00
|
|
|
exit:
|
|
|
|
print("hi\n")
|
|
|
|
goto exit
|
2008-08-20 16:46:05 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func f2() {
|
2011-03-15 12:05:07 -06:00
|
|
|
const c = 1234
|
2008-08-20 16:46:05 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func f3() {
|
2011-03-15 12:05:07 -06:00
|
|
|
i := c // ERROR "undef"
|
2023-03-22 16:04:35 -06:00
|
|
|
_ = i
|
2008-08-20 16:46:05 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
2011-03-15 12:05:07 -06:00
|
|
|
f3()
|
2008-08-20 16:46:05 -06:00
|
|
|
}
|