Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / staticcheck / testdata / src / CheckIneffectiveLoop / CheckIneffectiveLoop.go
1 package pkg
2
3 func fn() {
4         for {
5                 if true {
6                         println()
7                 }
8                 break // want `the surrounding loop is unconditionally terminated`
9         }
10         for {
11                 if true {
12                         break
13                 } else {
14                         break
15                 }
16         }
17         for range ([]int)(nil) {
18                 if true {
19                         println()
20                 }
21                 break // want `the surrounding loop is unconditionally terminated`
22         }
23         for range (map[int]int)(nil) {
24                 if true {
25                         println()
26                 }
27                 break
28         }
29         for {
30                 if true {
31                         goto Label
32                 }
33                 break
34         Label:
35         }
36         for {
37                 if true {
38                         continue
39                 }
40                 break
41         }
42         for {
43                 if true {
44                         continue
45                 }
46                 break
47         }
48 }
49
50 var z = func() {
51         for {
52                 if true {
53                         println()
54                 }
55                 break // want `the surrounding loop is unconditionally terminated`
56         }
57 }