.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.1.1 / staticcheck / testdata / src / CheckAddressIsNil / CheckAddressIsNil.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.1.1/staticcheck/testdata/src/CheckAddressIsNil/CheckAddressIsNil.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.1.1/staticcheck/testdata/src/CheckAddressIsNil/CheckAddressIsNil.go
new file mode 100644 (file)
index 0000000..cde6151
--- /dev/null
@@ -0,0 +1,13 @@
+package pkg
+
+func fn(x int, y *int) {
+       _ = &x == nil // want `the address of a variable cannot be nil`
+       _ = &y != nil // want `the address of a variable cannot be nil`
+
+       if &x != nil { // want `the address of a variable cannot be nil`
+               println("obviously.")
+       }
+
+       if y == nil {
+       }
+}