GoPLS Viewer

Home|gopls/cmd/guru/testdata/src/pointsto-json/main.go
1package main
2
3// Tests of 'pointsto' queries, -format=json.
4// See go.tools/guru/guru_test.go for explanation.
5// See pointsto-json.golden for expected query results.
6
7func main() { //
8    var s struct{ x [3]int }
9    p := &s.x[0// @pointsto val-p "p"
10    _ = p
11
12    var i I = C(0)
13    if i == nil {
14        i = new(D)
15    }
16    print(i// @pointsto val-i "\\bi\\b"
17}
18
19type I interface {
20    f()
21}
22
23type C int
24type D struct{}
25
26func (c Cf()  {}
27func (d *Df() {}
28
MembersX
I
C
D.f.d
D.f
main
main.i
D
C.f.c
C.f
Members
X