1
0
mirror of https://github.com/golang/go synced 2024-11-15 03:50:33 -07:00
go/test/fixedbugs/bug091.go
Robert Griesemer 8c5e8a38df go/types, types2: refactor initVars
As with changes in prior CLs, we don't suppress legitimate
"declared but not used" errors anymore simply because the
respective variables are used in incorrect assignments,
unrelated to the variables in question.
Adjust several (ancient) tests accordingly.

Change-Id: I5826393264d9d8085c64777a330d4efeb735dd2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/478716
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
2023-03-28 18:13:13 +00:00

27 lines
336 B
Go

// errorcheck
// 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() {
exit:
print("hi\n")
goto exit
}
func f2() {
const c = 1234
}
func f3() {
i := c // ERROR "undef"
_ = i
}
func main() {
f3()
}