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
I agree that go fmt should enforce some newlines, I'm not sure I agree with the rules you came up with, as this would mean that simple error checks have a new line before them.
newline after a block ({}\n) or multiple continious blocks (if {} else{}\n), this means a newline after every error check
the newline isn't added if the following line also closes a block
funcmain() {
for {
} // no newline here
}
There might be other cases where it makes sense to inject a newline.
I think this is highly opinonated and we should explore this with gofumpt first.
go fmt standardization of code is good in most cases but it goes soft on newline usage within code.
Why not have (one newline after statement and one newline before block) as a standard. This will avoid code uniformity.
Example:
Would become
The text was updated successfully, but these errors were encountered: