mirror of
https://github.com/gin-gonic/gin.git
synced 2025-05-19 16:38:19 +08:00
Routes() returns the function name of the main handler
This commit is contained in:
2
debug.go
2
debug.go
@ -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)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user