title: Calling methods from derived type in Go
body: <p>I have two files, generic_handler.go, which essentially looks like this:</p>
  
  <pre><code>type Handler struct{
      fields map[string]interface{}
  }
  
  func (handler *Handler) addField(key string, value interface{}){ some code }
  </code></pre>
  
  <p>And stat_handler.go:</p>
  
  <pre><code>type StatHandler Handler
  </code></pre>
  
  <p>When I try to call (from within the stat_handler.go file) the method like this, I get an error:</p>
  
  <pre><code>//inside some function
  stathandler.addField("some field", "some value")
  </code></pre>
  
  <p>It errors out with <code>type StatHandler has no field or method addField</code>. This is the same even if I export <code>addField</code> by making it <code>AddField</code>. Both of these files reside in the same package.</p>
  
  <p>Is there something I am missing?</p>