diff --git a/.grit/patterns/go/useless_if_else_body.md b/.grit/patterns/go/useless_if_else_body.md index 6759a902..2bbe8cfb 100644 --- a/.grit/patterns/go/useless_if_else_body.md +++ b/.grit/patterns/go/useless_if_else_body.md @@ -1,6 +1,6 @@ --- title: Identical statements in the if else body -tags: [fix, correctness] +tags: [fix, dead-code] --- Identical statements found in both the `if` and `else` bodies of an `if-statement`. This results in the same code execution regardless of the if-expression outcome. To optimize, eliminate the `if` statement entirely. @@ -9,7 +9,6 @@ Identical statements found in both the `if` and `else` bodies of an `if-statemen language go or { - `if ($conditon) { $body } else { $body }`, `if ($conditon) { $body } else if ($conditon) { $body }` } => `if ($conditon) { $body