Closed as not planned
Description
What version of Go are you using (go version
)?
$ go version go version go1.19rc2 linux/amd64
Also for many previous versions.
Does this issue reproduce with the latest release?
Yes
What did you do?
package main
func main() {}
func foo() (err error) {
{
err := bar()
if err != nil {
return
}
}
return
}
func bar() error {
return nil
}
What did you expect to see?
Complies okay.
What did you see instead?
Fails to compile.
$ go run main.go
# command-line-arguments
./main.go:9:4: result parameter err not in scope at return
./main.go:7:3: inner declaration of var err error