title: Recover call stack when spawning goroutines
body: <p>The following</p>
  <pre><code>func a() { b() }
  func b() { c() }
  func c() { d() }
  func d() {
      pc := make([]uintptr, 10)
      n := runtime.Callers(1, pc)
      if n == 0 {
          return
      }
  
      frames := runtime.CallersFrames(pc[:n])
  
      for {
          frame, more := frames.Next()
  
          fmt.Println(frame.Function)
  
          if !more {
              break
          }
      }
  
  }
  
  func main() {
      a()
      // The reason for this sleep will become apparent in an incoming example
      // where we spawn a goroutine and do not explicitely wait for it to finish
      time.Sleep(time.Second)
  }
  </code></pre>
  <p>outputs</p>
  <pre><code>main.d
  main.c
  main.b
  main.a
  main.main
  runtime.main
  runtime.goexit
  </code></pre>
  <p>as I expected. I am facing a situation where function <code>c</code> is called in a separate goroutine</p>
  <pre><code>func b() { go c() }
  </code></pre>
  <p>In such cas it outputs</p>
  <pre><code>main.d
  main.c
  runtime.goexit
  </code></pre>
  <p>, while I wished it to outpout the same as above.</p>
  <p>Is there a solution to this problem? Maybe something to capture a call stack and pass it to function <code>d</code>? Note that performance will matter and I wish to avoid processing the stack beforehand as in my real life example, <code>d</code> might or might not need to trigger the call to runtime.Callers.</p>