title: count / display the number of active goroutines
body: <p>I have a queue and a function that does both dequeueing and enqueueing. I want to make sure that the right amount of goroutines operate on the queue, as long as there is something in the list.</p>
  
  <p>This is the code I am using, but I was wondering if there is a way of printing the amount of currently active goroutines</p>
  
  <p><a href="http://play.golang.org/p/1bbV3F2644" rel="noreferrer">Link to playground</a></p>
  
  <pre><code>var element int
  
  func deen(queue chan int) {
  
      element := &lt;-queue
      fmt.Println("element is ", element)
      if element%2 == 0 {
          fmt.Println("new element is ", element)
          queue &lt;- (element*100 + 11)
          queue &lt;- (element*100 + 33)
      }
  }
  
  func main() {
      queue := make(chan int, 10)
      queue &lt;- 1
      queue &lt;- 2
      queue &lt;- 3
      queue &lt;- 0 
      for len(queue) != 0 {
          for i := 0; i &lt; 2; i++ {
              go deen(queue)
          }
      }
      fmt.Scanln()
      fmt.Println("list is has len", len(queue)) //this must be 0
  
  }    
  </code></pre>