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 / _CheckPredeterminedBooleanExprs.go.disabled
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/_CheckPredeterminedBooleanExprs.go.disabled b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/staticcheck/testdata/src/_CheckPredeterminedBooleanExprs.go.disabled
new file mode 100644 (file)
index 0000000..f77aab2
--- /dev/null
@@ -0,0 +1,18 @@
+package pkg
+
+import "math"
+
+func fn1() {
+       var x int
+       var y int
+       println(x == 0) // MATCH /x == 0 is always true for all possible values/
+       println(x == y) // MATCH /x == y is always true for all possible values/
+       x = 1
+       println(x > 0) // MATCH /x > 0 is always true for all possible values/
+       f := math.NaN()
+       println(f == f)
+}
+
+func fn2(x int) {
+       println(x == 0)
+}