From 8ae57475e0f2cc976b370514e1b391d5bf95c7d7 Mon Sep 17 00:00:00 2001 From: Tit Petric Date: Thu, 19 Jul 2018 20:21:53 +0200 Subject: [PATCH] del(codegen): remove route debug --- codegen/templates/http_routes.tpl | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/codegen/templates/http_routes.tpl b/codegen/templates/http_routes.tpl index 3f3d2839c..23a4b9f37 100644 --- a/codegen/templates/http_routes.tpl +++ b/codegen/templates/http_routes.tpl @@ -3,9 +3,6 @@ package {package} {load warning.tpl} import ( - "fmt" - "runtime" - "reflect" "github.com/go-chi/chi" "github.com/crusttech/crust/{project}/rest/server" @@ -25,20 +22,4 @@ func MountRoutes(r chi.Router) { }) }) {/foreach} - - var printRoutes func(chi.Routes, string, string) - printRoutes = func(r chi.Routes, indent string, prefix string) { - routes := r.Routes() - for _, route := range routes { - if route.SubRoutes != nil && len(route.SubRoutes.Routes()) > 0 { - fmt.Printf(indent+"%s - with %d handlers, %d subroutes\n", route.Pattern, len(route.Handlers), len(route.SubRoutes.Routes())) - printRoutes(route.SubRoutes, indent+"\t", prefix+route.Pattern[:len(route.Pattern)-2]) - } else { - for key, fn := range route.Handlers { - fmt.Printf("%s%s\t%s -> %s\n", indent, key, prefix+route.Pattern, runtime.FuncForPC(reflect.ValueOf(fn).Pointer()).Name()) - } - } - } - } - printRoutes(r, "", "") } \ No newline at end of file