if
statement for single bool judgment GO-R1004if
statement can be simplified where only a single bool judgment is happening. It is more
idiomatic not to store the result of a function returning a bool and compare that in if
statement's conditional. It is better to skip the initialization expression.
if ok := fn(); ok {
// body
}
if fn() {
// body
}