GoPLS Viewer

Home|gopls/go/callgraph/vta/testdata/src/callgraph_static.go
1// Copyright 2021 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// go:build ignore
6
7package testdata
8
9type A struct{}
10
11func (a Afoo() {}
12
13func Bar() {}
14
15func Baz(a A) {
16    a.foo()
17    Bar()
18    Baz(A{})
19}
20
21// Relevant SSA:
22// func Baz(a A):
23//   ...
24//   t2 = (A).foo(t1)
25//   t3 = Bar()
26//   ...
27//   t6 = Baz(t5)
28
29// WANT:
30// Baz: (A).foo(t1) -> A.foo; Bar() -> Bar; Baz(t5) -> Baz
31
MembersX
A.foo.a
A.foo
Members
X