GoPLS Viewer

Home|gopls/cmd/guru/testdata/src/imports/main.go
1package main
2
3import (
4    "lib"        // @describe ref-pkg-import "lib"
5    "lib/sublib" // @describe ref-pkg-import2 "sublib"
6)
7
8// Tests that import another package.  (To make the tests run quickly,
9// we avoid using imports in all the other tests.  Remember, each
10// query causes parsing and typechecking of the whole program.)
11//
12// See go.tools/guru/guru_test.go for explanation.
13// See imports.golden for expected query results.
14
15var a int
16
17func main() {
18    const c = lib.Const // @describe ref-const "Const"
19    lib.Func()          // @describe ref-func "Func"
20    lib.Var++           // @describe ref-var "Var"
21    var t lib.Type      // @describe ref-type "Type"
22    p := t.Method(&a)   // @describe ref-method "Method"
23
24    print(*p + 1// @pointsto p "p "
25
26    var _ lib.Type // @describe ref-pkg "lib"
27
28    _ = sublib.C
29}
30
MembersX
lib
sublib
a
main
main.c
main.t
main.p
Members
X