You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var (
meow=3foobar34=4interestingl43="something"m=3ok=true
)
Do:
var (
m=3ok=truemeow=3foobar34=4interestingl43="something"
)
For the benefits described in the article, namely it becomes very nice for git diffs because you only see the line that changed and its still super easy to read.
The text was updated successfully, but these errors were encountered:
Of course, all of this applies to lists where the entries are not semantically related: when listing color components one would always do “red, green, blue”, and not “green, blue, red”
But gofmt does not (and probably should not) know whether the variables are semantically related.
This proposal would mean two drastic changes to gofmt. First, the tool would now reorder declarations, which it has never done before. Second, it would no longer align them. The proposal needs to argue why the advantages are worth changing the formatting of so much existing code.
See https://hisham.hm/2018/06/16/when-listing-repeated-things-make-pyramids/
E.g. instead of this format:
Do:
For the benefits described in the article, namely it becomes very nice for git diffs because you only see the line that changed and its still super easy to read.
The text was updated successfully, but these errors were encountered: