Routes() returns the function name of the main handler

This commit is contained in:
Manu Mtz-Almeida
2015-06-07 13:49:36 +02:00
parent c7d2d82d01
commit 74fe36fa48
2 changed files with 21 additions and 13 deletions

View File

@ -16,7 +16,7 @@ func IsDebugging() bool {
func debugPrintRoute(httpMethod, absolutePath string, handlers HandlersChain) {
if IsDebugging() {
nuHandlers := len(handlers)
handlerName := nameOfFunction(handlers[nuHandlers-1])
handlerName := nameOfFunction(handlers.Last())
debugPrint("%-5s %-25s --> %s (%d handlers)\n", httpMethod, absolutePath, handlerName, nuHandlers)
}
}