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 / CheckDoubleNegation / CheckDoubleNegation.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/CheckDoubleNegation/CheckDoubleNegation.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/staticcheck/testdata/src/CheckDoubleNegation/CheckDoubleNegation.go
new file mode 100644 (file)
index 0000000..b230a23
--- /dev/null
@@ -0,0 +1,23 @@
+package pkg
+
+func fn(b1, b2 bool) {
+       if !!b1 { // want `negating a boolean twice`
+               println()
+       }
+
+       if b1 && !!b2 { // want `negating a boolean twice`
+               println()
+       }
+
+       if !(!b1) { // want `negating a boolean twice`
+               println()
+       }
+
+       if !b1 {
+               println()
+       }
+
+       if !b1 && !b2 {
+               println()
+       }
+}