Skip to content
Myr

Merge pull request #494 from dolmen/fix/indent-route-debug

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix indent of routes debug prints

authored by Manu Mtz.-Almeida · committed by Manu Mtz.-Almeida · parents e9531e5, 90911f5 · Browse files · 2 files+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−2 removed

  • other:+2 added−2 removed

2 files+2 added−2 removed

modified:debug_test.go+1 added-1 removed
61 unmodified lines
62 setup(&w)63 defer teardown()6465 debugPrintRoute("GET", "/path/to/route/:param", HandlersChain{func(c *Context) {}, handlerNameTest})66 assert.Equal(t, w.String(), "[GIN-debug] GET /path/to/route/:param --> github.com/gin-gonic/gin.handlerNameTest (2 handlers)\n")66 assert.Equal(t, w.String(), "[GIN-debug] GET /path/to/route/:param --> github.com/gin-gonic/gin.handlerNameTest (2 handlers)\n")67}6869func setup(w io.Writer) {70 SetMode(DebugMode)
7 unmodified lines
modified:debug.go+1 added-1 removed
22 unmodified lines
23func debugPrintRoute(httpMethod, absolutePath string, handlers HandlersChain) {24 if IsDebugging() {25 nuHandlers := len(handlers)26 handlerName := nameOfFunction(handlers.Last())27 debugPrint("%-5s %-25s --> %s (%d handlers)\n", httpMethod, absolutePath, handlerName, nuHandlers)27 debugPrint("%-6s %-25s --> %s (%d handlers)\n", httpMethod, absolutePath, handlerName, nuHandlers)28 }29}3031func debugPrintLoadTemplate(tmpl *template.Template) {
40 unmodified lines