...

Source file src/golang.org/x/tools/go/callgraph/cha/testdata/func.go

Documentation: golang.org/x/tools/go/callgraph/cha/testdata

     1  // +build ignore
     2  
     3  package main
     4  
     5  // Test of dynamic function calls; no interfaces.
     6  
     7  func A(int) {}
     8  
     9  var (
    10  	B = func(int) {}
    11  	C = func(int) {}
    12  )
    13  
    14  func f() {
    15  	pfn := B
    16  	pfn(0) // calls A, B, C, even though A is not even address-taken
    17  }
    18  
    19  // WANT:
    20  // Dynamic calls
    21  //   f --> A
    22  //   f --> init$1
    23  //   f --> init$2
    24  

View as plain text