1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-24 08:32:22 +02:00
revive/testdata/max_control_nesting.go

68 lines
784 B
Go
Raw Normal View History

2024-01-28 13:22:41 +02:00
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/
}
}
}
}
}