some deletions
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / staticcheck / testdata / src / CheckMaybeNil / CheckMaybeNil.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/CheckMaybeNil/CheckMaybeNil.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/staticcheck/testdata/src/CheckMaybeNil/CheckMaybeNil.go
deleted file mode 100644 (file)
index c443208..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-package pkg
-
-import "os"
-
-func fn1(x *int) {
-       _ = *x // want `possible nil pointer dereference`
-       if x != nil {
-               return
-       }
-}
-
-func fn2(x *int) {
-       if x == nil {
-               println("we should return")
-       }
-       _ = *x // want `possible nil pointer dereference`
-}
-
-func fn3(x *int) {
-       if x != nil {
-               _ = *x
-       }
-}
-
-func fn4(x *int) {
-       if x == nil {
-               x = gen()
-       }
-       _ = *x
-}
-
-func fn5(x *int) {
-       if x == nil {
-               x = gen()
-       }
-       _ = *x // want `possible nil pointer dereference`
-       if x == nil {
-               println("we should return")
-       }
-}
-
-func fn6() {
-       x := new(int)
-       if x == nil {
-               println("we should return")
-       }
-       // x can't be nil
-       _ = *x
-}
-
-func fn7() {
-       var x int
-       y := &x
-       if y == nil {
-               println("we should return")
-       }
-       // y can't be nil
-       _ = *y
-}
-
-func fn8(x *int) {
-       if x == nil {
-               return
-       }
-       // x can't be nil
-       _ = *x
-}
-
-func fn9(x *int) {
-       if x != nil {
-               return
-       }
-       // TODO(dh): not currently supported
-       _ = *x
-}
-
-func gen() *int { return nil }
-
-func die1(b bool) {
-       if b {
-               println("yay")
-               os.Exit(0)
-       } else {
-               println("nay")
-               os.Exit(1)
-       }
-}
-
-func die2(b bool) {
-       if b {
-               println("yay")
-               os.Exit(0)
-       }
-}
-
-func fn10(x *int) {
-       if x == nil {
-               die1(true)
-       }
-       _ = *x
-}
-
-func fn11(x *int) {
-       if x == nil {
-               die2(true)
-       }
-       _ = *x // want `possible nil pointer dereference`
-}