title: how to wrap gorilla mux func handler by yaag middleware
body: <p>I am following this tutorial. <a href="http://thenewstack.io/make-a-restful-json-api-go/" rel="nofollow">http://thenewstack.io/make-a-restful-json-api-go/</a></p>
  
  <pre><code>router := mux.NewRouter().StrictSlash(true)
  for _, route := range routes {
      router.
          Methods(route.Method).
          Path(route.Pattern).
          Name(route.Name).
          Handler(route.HandlerFunc)
  }
  </code></pre>
  
  <p>I need to wrap the endpoint func using yaag middleware.</p>
  
  <pre><code>r.HandleFunc("/", middleware.HandleFunc(handler))
  </code></pre>
  
  <p>How to achieve this?</p>
  
  <p>EDIT:
  I am wrapping in around the Logger and returning the haddler. Logger takes first argument, as http.Handle. So wrapping the route.HandlerFunc won't work. Can you please help me here?</p>
  
  <pre><code>handler := Logger(route.HandlerFunc, route.Name)
  
      router.
          Methods(route.Method).
          Path(route.Pattern).
          Name(route.Name).
          Handler(handler)
  </code></pre>