From 7a27c17374727d9b01c16ad09dc6153f4a3ddf26 Mon Sep 17 00:00:00 2001 From: Morgante Pell Date: Fri, 28 Jun 2024 12:09:08 -0700 Subject: [PATCH] fix: remove incorrect go rule --- .grit/patterns/go/useless_if_else_body.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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