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 / simple / testdata / src / CheckRedundantBreak / LintRedundantBreak.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/simple/testdata/src/CheckRedundantBreak/LintRedundantBreak.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/simple/testdata/src/CheckRedundantBreak/LintRedundantBreak.go
new file mode 100644 (file)
index 0000000..c7d42f7
--- /dev/null
@@ -0,0 +1,37 @@
+package pkg
+
+func fn(x int) {
+       switch x {
+       case 1:
+               println()
+               break // want `redundant break`
+       case 2:
+               println()
+       case 3:
+               break // don't flag cases only consisting of break
+       case 4:
+               println()
+               break
+               println()
+       case 5:
+               println()
+               if true {
+                       break // we don't currently detect this
+               }
+       case 6:
+               println()
+               if true {
+                       break
+               }
+               println()
+       }
+
+label:
+       for {
+               switch x {
+               case 1:
+                       println()
+                       break label
+               }
+       }
+}