1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-23 22:04:49 +02:00
Files
revive/testdata/identical_branches.go
chavacava 47205455ea feature: new rules identical-switch-branches and identical-ifelseif-branches
These new rules result from the refactoring of `identical-branches` that will cover only simple/single if..else statements.
2025-08-06 11:19:12 +02:00

41 lines
468 B
Go

package fixtures
func identicalBranches() {
if true { // MATCH /both branches of the if are identical/
} else {
}
if true {
}
if true {
print()
} else {
}
if true { // MATCH /both branches of the if are identical/
print()
} else {
print()
}
if true {
if true { // MATCH /both branches of the if are identical/
print()
} else {
print()
}
} else {
println()
}
if true {
println("something")
} else {
println("else")
}
}