1
0
mirror of https://github.com/mgechev/revive.git synced 2025-10-30 23:37:49 +02:00

fix lint issue

This commit is contained in:
chavacava
2025-09-19 07:40:33 +02:00
parent 7359bf9a2e
commit bd1744e119

View File

@@ -142,15 +142,15 @@ func (w *lintUnnecessaryConditional) replacementForAssignmentStmt(thenStmt *ast.
return "", false
}
thenLhs := astutils.GoFmt(thenStmt.Lhs[0])
thenLHS := astutils.GoFmt(thenStmt.Lhs[0])
elseStmt, ok := elseStmts[0].(*ast.AssignStmt)
if !ok {
return "", false
}
elseLhs := astutils.GoFmt(elseStmt.Lhs[0])
if thenLhs != elseLhs {
elseLHS := astutils.GoFmt(elseStmt.Lhs[0])
if thenLHS != elseLHS {
return "", false
}
@@ -159,7 +159,7 @@ func (w *lintUnnecessaryConditional) replacementForAssignmentStmt(thenStmt *ast.
return "", false
}
return fmt.Sprintf("%s %s", thenLhs, thenStmt.Tok.String()), thenBoolStr == "true"
return fmt.Sprintf("%s %s", thenLHS, thenStmt.Tok.String()), thenBoolStr == "true"
}
// replacementForReturnStmt returns a replacement statement != ""