2 ms·
Why not int x? :) No confusion there! Except what that actually is underlying it all. I'm actually shocked that Go even has pointers given coding C++ at Google
by azinman2 14y ago
Why not int x? :) No confusion there! Except what that actually is underlying it all. I'm actually shocked that Go even has pointers given coding C++ at Google was all about passing by reference, although at least they put a lot of sane constraints on them (no pointing to arbitrary memory addresses, no pointer arithmetic, etc).
Google code style guidelines are anti-one liner, so that's not surprising to me that Go's formatter tries to enforce that.
I also employ one-liners but judiciously. It can be easy to miss the condition or side effect, particularly with returns. I waffle on whether it should or shouldn't be allowed. But there's something to code compactness on large projects...