jadekler/git-go-websiteskeleton — pull request #18 by bryfry (2014-10-12 20:38:39+00:00)
Title: simplify httpInterceptor pattern

Sorry the changes show every line changed, gofmt did that.

The actual fix is to simplify the httpInterceptor pattern. Since a mux satisfies the handler interface we can avoid the global router var by passing the router to the httpInterceptor (#L21 and #L35-53) and perform the ServeHTTP on it (#L39).

You need to do the right dance at the function definition to get all three needed vars inside the function (router, w, req) (#L35-36)