Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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

> 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



Yeah, right, I didn't see the external variable. I might as well go ahead and delete the comment :P




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: