Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.0.0-20201028153306-37f0764111ff / internal / lsp / analysis / undeclaredname / testdata / src / a / a.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201028153306-37f0764111ff/internal/lsp/analysis/undeclaredname/testdata/src/a/a.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201028153306-37f0764111ff/internal/lsp/analysis/undeclaredname/testdata/src/a/a.go
new file mode 100644 (file)
index 0000000..81c7320
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright 2020 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package undeclared
+
+func x() int {
+       var z int
+       z = y // want "undeclared name: y"
+
+       if z == m { // want "undeclared name: m"
+               z = 1
+       }
+
+       if z == 1 {
+               z = 1
+       } else if z == n+1 { // want "undeclared name: n"
+               z = 1
+       }
+
+       switch z {
+       case 10:
+               z = 1
+       case a: // want "undeclared name: a"
+               z = 1
+       }
+       return z
+}