Is is possible to use Gorilla's context.ClearHandler()
as middleware for Negroni like I've seen it used as middleware for Alice? Something like:
n.Use(context.ClearHandler())
At the moment I'm calling context.Clear(r)
after every response but I would prefer the tidying up to be taken care of automatically. I'm currently getting the following error:
cannot use context.ClearHandler() (type http.Handler) as type negroni.Handler in argument to n.Use:
http.Handler does not implement negroni.Handler (wrong type for ServeHTTP method)
have ServeHTTP(http.ResponseWriter, *http.Request)
want ServeHTTP(http.ResponseWriter, *http.Request, http.HandlerFunc)
But I'm not sure what the error message is telling me.