mirror of
https://github.com/golang/go
synced 2024-11-11 12:49:30 +00:00
8c5e8a38df
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>
27 lines
336 B
Go
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()
|
|
}
|