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 / CheckInfiniteEmptyLoop / CheckInfiniteEmptyLoop.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/staticcheck/testdata/src/CheckInfiniteEmptyLoop/CheckInfiniteEmptyLoop.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/staticcheck/testdata/src/CheckInfiniteEmptyLoop/CheckInfiniteEmptyLoop.go
new file mode 100644 (file)
index 0000000..2cd45a7
--- /dev/null
@@ -0,0 +1,33 @@
+package pkg
+
+func fn2() bool { return true }
+
+func fn() {
+       for { // want `this loop will spin`
+       }
+
+       for fn2() {
+       }
+
+       for {
+               break
+       }
+
+       for true { // want `loop condition never changes` `this loop will spin`
+       }
+
+       x := true
+       for x { // want `loop condition never changes` `this loop will spin`
+       }
+
+       x = false
+       for x { // want `loop condition never changes` `this loop will spin`
+       }
+
+       for false {
+       }
+
+       false := true
+       for false { // want `loop condition never changes` `this loop will spin`
+       }
+}