From c2abae684033088c94d39b652006dde3ea504532 Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Wed, 20 May 2015 11:32:39 +0200 Subject: [PATCH] debugPrintRoute() is called in the lowest layer of abstraction --- gin.go | 2 ++ routergroup.go | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gin.go b/gin.go index 0d8c5bc..08fc0f6 100644 --- a/gin.go +++ b/gin.go @@ -141,6 +141,8 @@ func (engine *Engine) rebuild405Handlers() { } func (engine *Engine) addRoute(method, path string, handlers HandlersChain) { + debugPrintRoute(method, path, handlers) + if path[0] != '/' { panic("path must begin with '/'") } diff --git a/routergroup.go b/routergroup.go index 816d74a..c8907fc 100644 --- a/routergroup.go +++ b/routergroup.go @@ -45,7 +45,6 @@ func (group *RouterGroup) Group(relativePath string, handlers ...HandlerFunc) *R func (group *RouterGroup) handle(httpMethod, relativePath string, handlers HandlersChain) { absolutePath := group.calculateAbsolutePath(relativePath) handlers = group.combineHandlers(handlers) - debugPrintRoute(httpMethod, absolutePath, handlers) group.engine.addRoute(httpMethod, absolutePath, handlers) }