|
|
@@ -5,9 +5,10 @@
|
|
|
package gin
|
|
|
|
|
|
import (
|
|
|
- "github.com/julienschmidt/httprouter"
|
|
|
"net/http"
|
|
|
"path"
|
|
|
+
|
|
|
+ "github.com/julienschmidt/httprouter"
|
|
|
)
|
|
|
|
|
|
// Used internally to configure router, a RouterGroup is associated with a prefix
|
|
|
@@ -46,11 +47,7 @@ func (group *RouterGroup) Group(relativePath string, handlers ...HandlerFunc) *R
|
|
|
func (group *RouterGroup) Handle(httpMethod, relativePath string, handlers []HandlerFunc) {
|
|
|
absolutePath := group.calculateAbsolutePath(relativePath)
|
|
|
handlers = group.combineHandlers(handlers)
|
|
|
- if IsDebugging() {
|
|
|
- nuHandlers := len(handlers)
|
|
|
- handlerName := nameOfFunction(handlers[nuHandlers-1])
|
|
|
- debugPrint("%-5s %-25s --> %s (%d handlers)\n", httpMethod, absolutePath, handlerName, nuHandlers)
|
|
|
- }
|
|
|
+ debugRoute(httpMethod, absolutePath, handlers)
|
|
|
|
|
|
group.engine.router.Handle(httpMethod, absolutePath, func(w http.ResponseWriter, req *http.Request, params httprouter.Params) {
|
|
|
context := group.engine.createContext(w, req, params, handlers)
|