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 am going to close this again. Rationale:
While it wouldn't be too hard to fix this, it is not clear that it is the right thing to
do: In general, gofmt respects extra newlines (up to a max. of one at this point), so
removing it here would mean changing that rule. We have code in the library of the form:
if some_condition {
alot-of-code-here
} else {
alot-of-code-here
}
where the extra empty lines around the inner code blocks are intentional to make the
overall structure more visible. Doing a good formatting job here would mean to either a)
recognize this case and not eliminate the empty lines, or b) recognize this case and
eliminate the empty lines before and after (context-sensitive). This kind of
larger-scale context sensitive formatting is non-trivial in the current implementation
of gofmt and generally not done.
The text was updated successfully, but these errors were encountered: