github.com/april1989/origin-go-tools@v0.0.32/cmd/callgraph/testdata/src/pkg/pkg.go (about)

     1  package main
     2  
     3  type I interface {
     4  	f()
     5  }
     6  
     7  type C int
     8  
     9  func (C) f() {}
    10  
    11  type D int
    12  
    13  func (D) f() {}
    14  
    15  func main() {
    16  	var i I = C(0)
    17  	i.f() // dynamic call; f()@main()
    18  
    19  	main2() //main2()@main()
    20  }
    21  
    22  func main2() { //main2()@main()
    23  	var i I = D(0)
    24  	i.f() // dynamic call; f()@main2(),main2()@main()
    25  }