blob: dbb1287a151777ba14dd26b633ed9040288243c8 [file] [log] [blame]
Russ Cox2b1c9b42012-02-16 23:49:30 -05001// errorcheck
Rob Pike3308eb42008-08-20 15:46:05 -07002
3// Copyright 2009 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.
6
7package main
8
9func f1() {
Russ Coxe72156b2011-03-15 14:05:07 -040010exit:
11 print("hi\n")
12 goto exit
Rob Pike3308eb42008-08-20 15:46:05 -070013}
14
15func f2() {
Russ Coxe72156b2011-03-15 14:05:07 -040016 const c = 1234
Rob Pike3308eb42008-08-20 15:46:05 -070017}
18
19func f3() {
Russ Coxe72156b2011-03-15 14:05:07 -040020 i := c // ERROR "undef"
Rob Pike3308eb42008-08-20 15:46:05 -070021}
22
23func main() {
Russ Coxe72156b2011-03-15 14:05:07 -040024 f3()
Rob Pike3308eb42008-08-20 15:46:05 -070025}