.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.1.1 / simple / testdata / src / single-case-select / single-case-select.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.1.1/simple/testdata/src/single-case-select/single-case-select.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.1.1/simple/testdata/src/single-case-select/single-case-select.go
new file mode 100644 (file)
index 0000000..6b53458
--- /dev/null
@@ -0,0 +1,28 @@
+package pkg
+
+func fn() {
+       var ch chan int
+       select { // want `should use a simple channel send`
+       case <-ch:
+       }
+outer:
+       for { // want `should use for range`
+               select {
+               case <-ch:
+                       break outer
+               }
+       }
+
+       for { // want `should use for range`
+               select {
+               case x := <-ch:
+                       _ = x
+               }
+       }
+
+       for {
+               select { // want `should use a simple channel send`
+               case ch <- 0:
+               }
+       }
+}