title: How to identify a goroutine?
body: <p>Let's say I have a stacktrace for a bunch of goroutines, e. g.:</p>
  
  <pre><code>goroutine 5633 [select]:
  net/http.(*persistConn).writeLoop(0xc21303ac00)
      /usr/lib/go/src/pkg/net/http/transport.go:791 +0x271
  created by net/http.(*Transport).dialConn
      /usr/lib/go/src/pkg/net/http/transport.go:529 +0x61e
  </code></pre>
  
  <p>In my case a unique application-specific object is served by a set of goroutines, and I want to look at the stacktrace of goroutines relating to a particular object. I have hundreds of application-specific objects, so I get hundreds of identical goroutines.</p>
  
  <p>How would I go about correlating my logs with goroutines in the stacktrace? There doesn't seem to be a way of identifying a current goroutine in a stack trace and no way of naming a goroutine so I can see a specific value in stack trace.</p>
  
  <p>PS</p>
  
  <p>I've already read the related why-would-you-want-to-do-it posts on Go mailing list, so I'm looking for alternatives/hacks/workarounds (that hopefully don't involve sprinkling the code with a log call every other line).</p>