1
0
mirror of https://github.com/golang/go synced 2024-11-05 18:56:10 -07:00
go/cmd/callgraph/testdata/src/pkg/pkg.go
Alan Donovan b8a5fcfcec cmd/callgraph: a utility for dumping the callgraph of a Go program.
(This functionality is provided by the oracle, but its output
format is inflexible, and the functionality is better suited
to a shell utility.  I may remove the oracle 'callgraph' feature.)

See Usage for details.

+ Test.

LGTM=sameer
R=sameer
CC=golang-codereviews, gri
https://golang.org/cl/164460044
2014-11-12 17:36:22 -05:00

26 lines
221 B
Go

package main
type I interface {
f()
}
type C int
func (C) f() {}
type D int
func (D) f() {}
func main() {
var i I = C(0)
i.f() // dynamic call
main2()
}
func main2() {
var i I = D(0)
i.f() // dynamic call
}