1
0
mirror of https://github.com/mgechev/revive.git synced 2024-12-12 10:44:59 +02:00
revive/testdata/max_control_nesting.go
2024-11-11 19:31:18 +01:00

68 lines
784 B
Go

package fixtures
func mcn() {
if true {
if true {
if true { // MATCH /control flow nesting exceeds 2/
}
}
} else {
if true {
if true { // MATCH /control flow nesting exceeds 2/
if true {
}
}
}
}
for {
if true {
for { // MATCH /control flow nesting exceeds 2/
}
}
}
switch {
case false:
if true {
}
case true:
if true {
for { // MATCH /control flow nesting exceeds 2/
}
}
default:
}
select {
case msg1 := <-c1:
println("received", msg1)
case msg2 := <-c2:
if true {
for { // MATCH /control flow nesting exceeds 2/
}
}
}
if true {
f1 := func() {
if true {
for {
}
}
}
}
f1 := func() {
for {
if true {
for { // MATCH /control flow nesting exceeds 2/
}
}
}
}
}