是否可以将Gorilla context.ClearHandler()用作 Negroni 的中间件,就像我看到它用作 Alice 的中间件一样?就像是:
n.Use(context.ClearHandler())
目前我context.Clear(r)在每次回复后都会打电话,但我希望自动进行整理。我目前收到以下错误:
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)
但我不确定错误消息告诉我什么。