False positive with label breaks
tobiasgiese opened this issue · comments
Tobias Giese commented
False positive using labeled breaks
package main
func main() {
foo := true
BREAKOUT:
for i := range []int{0, 1, 2} {
for j := range []int{0, 1, 2} {
if j == 2 && i == 2 {
foo = false
break BREAKOUT
}
}
}
if foo {
return
}
}
$ ifshort main.go
/tmp/main.go:4:2: variable 'foo' is only used in the if-statement (/tmp/main.go:14:2); consider using short syntax