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:46:12 +02:00
parent bd1744e119
commit 52c2c4d9a3

View File

@@ -42,13 +42,13 @@ type lintUnnecessaryConditional struct {
onFailure func(lint.Failure)
}
// Visit walks the AST looking for if statements of the form
// Visit walks the AST looking for if statements of the form:
//
// if cond { return <bool literal> } else { return <bool literal> }
//
// or
//
// if cond { <idX> = <bool literal> } else { <idX> = <bool literal> }
// if cond { <idX> = <bool literal> } else { <idX> = <bool literal> }.
func (w *lintUnnecessaryConditional) Visit(node ast.Node) ast.Visitor {
ifStmt, ok := node.(*ast.IfStmt)
if !ok {