Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
cmd/gofmt: inconsistent spaces around bitwise & #12720
What I did: used gofmt on my source code
I have put "before" and "after" code into a gist, so from the diff you can easily see the changes applied by gofmt
@griesemer I did look for duplicates although, I guess, I only checked open issues (will look better next time).
All but #11497 are closed for the reasons of emphasizing the precedence in otherwise complex expressions. Do we have to highlight in this example
I read the long comment for
I am sorry, but in my opinion this error report is different from other closed reports. I could not find the answer from
@RomanSaveljev "(arr, i & maxKeys)" is not a single expression. But the point is that "i & maxKeys" if standing "alone", including standing alone inside ()'s, gets the space around the '&', and otherwise it won't. Which is why we get
to show some examples. That is, an expression inside a parameter list (== a list of expressions) is treated similarly to an expression inside larger expression (e.g., "a list of terms in a sum" as in a + b + c where each a, b, c is "inside").