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
{{ message }}
This repository has been archived by the owner on May 9, 2021. It is now read-only.
Greetings. golint complains about the following if statement, claiming that it has a "unnecessary leading newline (whitespace)":
# Multi-line if statement 1
if condition1ThatisReallyLong &&
condition2ThatisReallyLong &&
condition3ThatisReallyLong &&
condition4ThatisReallyLong {
foo()
}
However, this does not appear to be true - doesn't it have a trailing newline instead of a leading newline? (This appears to be a bug.) Regardless, that isn't even the point of the issue.
golint does not complain about the following if statement:
# Multi-line if statement 2
if condition1ThatisReallyLong &&
condition2ThatisReallyLong &&
condition3ThatisReallyLong &&
condition4ThatisReallyLong {
foo()
}
Is the second multi-line if statement the preferred form? If yes, isn't this problematic in that it is difficult to distinguish between if statement conditions and block code?
If no, then what is the preferred form of a multi-line if statement in golang?
The text was updated successfully, but these errors were encountered:
I don't know, but a few of my colleagues had the same issues with
golangci-lint. It would often report issues and say that it comes from
the tool foo, but running foo directly produces no issues. I personally
don't use it, as I see no point in it.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Greetings.
golint
complains about the following if statement, claiming that it has a "unnecessary leading newline (whitespace)":However, this does not appear to be true - doesn't it have a trailing newline instead of a leading newline? (This appears to be a bug.) Regardless, that isn't even the point of the issue.
golint
does not complain about the following if statement:The text was updated successfully, but these errors were encountered: