On Sun, 2020-01-12 at 10:10 +0100, Silvan Jegen wrote:
> So the declaration of the variables in the for loop itself is in
> outer scope compared to the body of the for loop?

Yes.

> In that case, redeclaring them in the inner scope (== the loop body)
> would not be allowed either, no?

What?

The body is a new scope, so the redeclaration is valid without any new
vars.

This can be demonstrated here: https://play.golang.org/p/Xpc40xZVzz8

-- 
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 golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/78c88f6c6a32e328f79a54b16fd1238c108f7e16.camel%40kortschak.io.

Reply via email to