Debian Codegraph @

staticcheck/sa5004/testdata/go1.0/CheckLoopEmptyDefault/CheckLoopEmptyDefault.go

raw
1 package pkg
2
3 func fn() {
4 var ch chan int
5 select {
6 case <-ch:
7 default:
8 }
9
10 for {
11 select {
12 case <-ch:
13 default: //@ diag(`should not have an empty default case`)
14 }
15 }
16
17 for {
18 select {
19 case <-ch:
20 default:
21 println("foo")
22 }
23 }
24
25 for {
26 select {
27 case <-ch:
28 }
29 }
30 }