OK, it's a block scope thing, because using an "if" statement I can also violate the rule that "at least one of the non-blank variables is new".
https://go.dev/play/p/9_B8OZQFe_n func main() { var code int var err error if code, err := myfunc(); err != nil { // this is accepted fmt.Printf("Error: %s", err) _ = code return } fmt.Printf("code is %d, err is %v", code, err) // 0, <nil> } So I need to imagine a curly bracket enclosing the whole 'if' statement. Sorry for the noise. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/67a77745-1391-46b1-99dd-7a2cf4a0f496n%40googlegroups.com.
