.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.1.1-0.20210319172145-bda8f5cee399 / cmd / guru / testdata / src / imports / main.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.1.1-0.20210319172145-bda8f5cee399/cmd/guru/testdata/src/imports/main.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.1.1-0.20210319172145-bda8f5cee399/cmd/guru/testdata/src/imports/main.go
new file mode 100644 (file)
index 0000000..9fe2b71
--- /dev/null
@@ -0,0 +1,29 @@
+package main
+
+import (
+       "lib"        // @describe ref-pkg-import "lib"
+       "lib/sublib" // @describe ref-pkg-import2 "sublib"
+)
+
+// Tests that import another package.  (To make the tests run quickly,
+// we avoid using imports in all the other tests.  Remember, each
+// query causes parsing and typechecking of the whole program.)
+//
+// See go.tools/guru/guru_test.go for explanation.
+// See imports.golden for expected query results.
+
+var a int
+
+func main() {
+       const c = lib.Const // @describe ref-const "Const"
+       lib.Func()          // @describe ref-func "Func"
+       lib.Var++           // @describe ref-var "Var"
+       var t lib.Type      // @describe ref-type "Type"
+       p := t.Method(&a)   // @describe ref-method "Method"
+
+       print(*p + 1) // @pointsto p "p "
+
+       var _ lib.Type // @describe ref-pkg "lib"
+
+       _ = sublib.C
+}