diff --git a/crm/rest/router.go b/crm/rest/router.go index 4a20963f7..b7d3c55d6 100644 --- a/crm/rest/router.go +++ b/crm/rest/router.go @@ -16,10 +16,7 @@ package rest */ import ( - "fmt" "github.com/go-chi/chi" - "reflect" - "runtime" "github.com/crusttech/crust/crm/rest/server" ) @@ -49,20 +46,4 @@ func MountRoutes(r chi.Router) { r.Delete("/{module}/content/{id}", module.ContentDelete) }) }) - - 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, "", "") } diff --git a/sam/rest/router.go b/sam/rest/router.go index 1861d9919..f57e380a1 100644 --- a/sam/rest/router.go +++ b/sam/rest/router.go @@ -16,10 +16,7 @@ package rest */ import ( - "fmt" "github.com/go-chi/chi" - "reflect" - "runtime" "github.com/crusttech/crust/sam/rest/server" ) @@ -83,20 +80,4 @@ func MountRoutes(r chi.Router) { r.Get("/search", user.Search) }) }) - - 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, "", "") }