title: where does the ServeHTTP method come from
body: <p>This has confused me for the last month of learning Go:</p>
  
  <pre><code>func Auth(next http.HandlerFunc) http.HandlerFunc {
  
      return func(w http.ResponseWriter, r *http.Request) {  // hmmmm
  
          // ...
          next.ServeHTTP(w, r)
      }
  }
  </code></pre>
  
  <p>here we can see that the Auth func returns type <code>http.HandlerFunc</code>.
  That type is just a func. So when you call <code>next.ServeHTTP</code>, when/where is that method defined?</p>