2 ms·
> I suggest to keep things consistent and actually use the syntax /* */ for multi-line comments Idiomatic Go code almost never uses multi-line comments, see:
by mseepgood 13y ago
> I suggest to keep things consistent and actually use the syntax /* */ for multi-line comments
Idiomatic Go code almost never uses multi-line comments, see:
http://golang.org/src/pkg/net/http/request.go http://golang.org/src/pkg/net/http/request.go
> Also "// x == 1 here." should be "// x == 2 here."
No, it's correct. := declares a new variable. The newly declared, inner x shadows the outer x only within the block scope of the for loop:
http://play.golang.org/p/cP2dWyg0qw http://play.golang.org/p/cP2dWyg0qw
- cliveowen 13y agoYeah, right, I didn't see the external variable. I might as well go ahead and delete the comment :P