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

add test with complex condition

This commit is contained in:
chavacava
2025-09-22 11:06:21 +02:00
parent 52c2c4d9a3
commit 7cdb6cfc2b

View File

@@ -130,6 +130,12 @@ func unnecessaryConditional() bool {
id = true
}
if (something > 0) && (!id) || (something+10 <= 0) { // MATCH /replace this conditional by: id = !((something > 0) && (!id) || (something+10 <= 0))/
id = false
} else {
id = true
}
// conditionals with initialization
if cond := false; cond {
return true