From b6c2ec539c9c8ddfd134601703b515bd89505964 Mon Sep 17 00:00:00 2001 From: nolwn Date: Mon, 7 Sep 2020 17:47:03 -0700 Subject: [PATCH] Removed logs --- router.go | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/router.go b/router.go index dd40d3a..f0ead4a 100644 --- a/router.go +++ b/router.go @@ -2,7 +2,6 @@ package router import ( "errors" - "fmt" "net/http" "strings" ) @@ -81,19 +80,9 @@ func (r *Router) AddRoute(method string, path string, callback http.HandlerFunc) r.routes = append(r.routes, route{method, path, callback}) } - checkLookup(r.lookup) - return } -func checkLookup(curr *segment) { - fmt.Printf("%p { path: %s, methods: %v, children: %v}\n", curr, curr.path, curr.methods, curr.children) - - for _, v := range curr.children { - checkLookup(v) - } -} - // Handler returns the handler to use for the given request, // consulting r.Method, r.URL.Path. It always returns // a non-nil handler. @@ -109,8 +98,6 @@ func (r *Router) Handler(req *http.Request) (h http.Handler, pattern string) { root := r.lookup curr := root - fmt.Printf("The route handler has been called. %s", req.URL.Path) - segments := strings.Split(path, "/") keys := setupKeys(segments) @@ -175,8 +162,6 @@ func (r *Router) Get(path string, callback http.HandlerFunc) { // In the case of this router, all it needs to do is lookup the Handler that has been saved at a given // path and then call its ServeHTTP. func (r Router) ServeHTTP(w http.ResponseWriter, req *http.Request) { - fmt.Print("Router's ServeHTTP method has been called.") - handler, _ := r.Handler(req) handler.ServeHTTP(w, req)