如何设置GorillaMuxr.Use以在中间件链中返回错误?https://godoc.org/github.com/gorilla/mux#Router.UseMain.gor:=mux.NewRouter()r.Use(LoggingFunc)r.Use(AuthFunc)基础中间件从日志记录中间件开始,它可以捕获和处理来自更下游链的错误typeHandlerFuncfunc(whttp.ResponseWriter,r*http.Request)errorfuncLoggingFunc(nextHandlerFunc)http.Handler{returnhttp.Handle
如何设置GorillaMuxr.Use以在中间件链中返回错误?https://godoc.org/github.com/gorilla/mux#Router.UseMain.gor:=mux.NewRouter()r.Use(LoggingFunc)r.Use(AuthFunc)基础中间件从日志记录中间件开始,它可以捕获和处理来自更下游链的错误typeHandlerFuncfunc(whttp.ResponseWriter,r*http.Request)errorfuncLoggingFunc(nextHandlerFunc)http.Handler{returnhttp.Handle