title: Golang getting an undefined type error when using a struct
body: <p>I am using a thread-pool example from <a href="http://marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang/" rel="nofollow noreferrer">http://marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang/</a> and I am following that tutorial however I am getting this error on compile <strong>d.pool undefined (type *Dispatcher has no field or method pool)</strong> this is the code</p>
  
  <pre><code>   type Dispatcher struct {
          // A pool of workers channels that are registered with the dispatcher
          WorkerPool chan chan Job
      }
  
       func NewWorker(workerPool chan chan Job) Worker {
      return Worker{
          WorkerPool: workerPool,
          JobChannel: make(chan Job),
          quit:       make(chan bool)}
  }
  
      func NewDispatcher(maxWorkers int) *Dispatcher {
          pool := make(chan chan Job, maxWorkers)
          return &amp;Dispatcher{WorkerPool: pool}
      }
  
  
  
      func (d *Dispatcher) Run() {
          // starting n number of workers
             //d.WorkerPool
  
          for i := 0; i &lt; 5; i++ {
              worker := NewWorker(d.pool)
              worker.Start()
          }
  
          go d.dispatch()
      }
  </code></pre>
  
  <p>The error is happening with this code</p>
  
  <p><strong>worker := NewWorker(d.pool)</strong></p>
  
  <p>Any solutions or suggestions would be great as I am new to this but am trying to implement a thread pool</p>