Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
maxiepoo
on April 22, 2014
|
parent
|
context
|
favorite
| on:
Space Monkey dumps Python for Go
Yes and in Go (and hopefully all curly-brace languages of the future) this is actually a syntax error, you need the braces:
if (a < b) { a = b; }
TylerE
on April 22, 2014
|
next
[–]
The thing I don't get...if braces are mandatory (Good), why keep the now completely, unambiguously, irrelevant () around the cond?
kyrra
on April 22, 2014
|
parent
|
next
[–]
If you ran the code through gofmt, it would remove the () around the cond for you. I code go in SublimeText with GoSublime. On every save it runs the file through gofmt and reformats it for me. Keeps my code looking pretty with very little effort.
wtbob
on April 22, 2014
|
parent
|
prev
|
next
[–]
You don't need those parens in Go, and go fmt will in fact remove them/
CasualSuperman
on April 22, 2014
|
parent
|
prev
|
next
[–]
They're actually not required in Go.
gnur
on April 22, 2014
|
prev
[–]
And you don't need the semicolons!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: