U know , when I write a middleware to handle log, then I put a handle resource(e.g. handle GET) middleware in front of it, and I post my code here, hope anyone can help me. Thanks.
v1Group := s.router.Group("/v1")
v1Group.Use(v1.newOtherHandler().Handle) //handle other things
v1Group.Use(v1.NewUserHandler().Handle) //handle user
{
v1.NewhandleResource(v1Group) //handle resource
}
v1Group.Use(v1.newLogHandler.Handle) //handle log
I use router.Set("demo") and router.Get("demo") to pass handle resource value to handle log function. But the program couldn't exec handle log. Anything in v1.newLogHandler.Handle function is not dealt. when I put log handler on resource handler, it can be execute. So u can simple think that any middleware under resource handler can't be executed. That's Why?