1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-23 22:04:49 +02:00
Files
revive/testdata/enforce_else.go
2025-08-04 06:43:36 +02:00

54 lines
1.0 KiB
Go

package fixtures
func enforceElse() {
if true {
// something
} else if true { // MATCH /"if ... else if" constructs should end with "else" clauses/
// something else
}
if true {
return
} else if true {
return
}
if true {
break
} else if true {
break
}
if true {
return
} else if true { // MATCH /"if ... else if" constructs should end with "else" clauses/
// something else
}
if true {
// something
} else if true { // MATCH /"if ... else if" constructs should end with "else" clauses/
return
}
if true {
// something
} else if true { // MATCH /"if ... else if" constructs should end with "else" clauses/
if true {
// something
} else if true { // MATCH /"if ... else if" constructs should end with "else" clauses/
return
}
}
if true {
if true {
// something
} else if true { // MATCH /"if ... else if" constructs should end with "else" clauses/
return
}
} else if true { // MATCH /"if ... else if" constructs should end with "else" clauses/
// something
}
}