You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varmatch mux.RouteMatchvarhandler http.Handlerreq:=&http.Request{}
req.URL=&url.URL{Path: "/post"}
req.Method="POST"ifbuilder.router.Match(req, &match) {
// Get the matched handler along with middlewarematchedHandler:=match.MatchedHandler// Define a temporary http.HandlerFunc to capture the inner handlertempHandlerFunc:=func(w http.ResponseWriter, r*http.Request) {
handler=matchedHandler
}
// Call the middleware with the temporary handlerfor_, mw:=rangematch.Handler.Middlewares() {
tempHandlerFunc=mw(tempHandlerFunc)
}
// Now 'handler' should contain the inner handler without middleware
}
g.Expect(handler).ToNot(BeNil())
fmt.Println(handler)
Unrelated, but I'm looking to contribute to this project in any capacity, but all I'm seeing in Issues are questions and discussions.
I'm trying to write a test to confirm that both the POST and PATCH methods of the same URL go to the same handler.
So I tried the following
handler
func is actually the handler func but wrapped in the MDW. Therefore, I couldn't assert that thehandler
was equal to my desired handler funcAny tips ?
The text was updated successfully, but these errors were encountered: