Debian Codegraph @

gopls/internal/test/marker/testdata/references/intrapackage.txt

raw
1 Basic test of references within a single package.
2
3 -- go.mod --
4 module example.com
5 go 1.12
6
7 -- a/a.go --
8 package a
9
10 type i int //@loc(decli, "i"), refs("i", decli, argi, returni, embeddedi)
11
12 func _(_ i) []bool { //@loc(argi, "i")
13 return nil
14 }
15
16 func _(_ []byte) i { //@loc(returni, "i")
17 return 0
18 }
19
20 var q string //@loc(declq, "q"), refs("q", declq, assignq, bobq)
21
22 var Q string //@loc(declQ, "Q"), refs("Q", declQ)
23
24 func _() {
25 q = "hello" //@loc(assignq, "q")
26 bob := func(_ string) {}
27 bob(q) //@loc(bobq, "q")
28 }
29
30 type e struct {
31 i //@loc(embeddedi, "i"), refs("i", embeddedi, embeddediref)
32 }
33
34 func _() {
35 _ = e{}.i //@loc(embeddediref, "i")
36 }