From 2120b5da8f2b56314247fcbce6ffa65cce7aa4d4 Mon Sep 17 00:00:00 2001 From: NiseVoid Date: Sat, 8 Apr 2023 18:07:22 +0200 Subject: [PATCH] Rename getHttpr to GetHandler --- router.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/router.go b/router.go index d869fc6..9f18b52 100644 --- a/router.go +++ b/router.go @@ -97,7 +97,7 @@ func (r *Router) OPTIONS(path string, handle Handle, middleware ...Middleware) { // Start starts the web server and binds to the given address func (r *Router) Start(addr string) error { - httpr := r.getHttpr() + httpr := r.GetHandler() r.server = &http.Server{Addr: addr, Handler: httpr} return r.server.ListenAndServe() @@ -105,7 +105,7 @@ func (r *Router) Start(addr string) error { // StartTLS starts a TLS web server using the given key, cert and config and binds to the given address func (r *Router) StartTLS(addr, certFile, keyFile string, conf *tls.Config) error { - httpr := r.getHttpr() + httpr := r.GetHandler() r.server = &http.Server{Addr: addr, Handler: httpr, TLSConfig: conf} return r.server.ListenAndServeTLS(certFile, keyFile) @@ -128,7 +128,7 @@ func (r *Router) Stop() error { return err } -func (r *Router) getHttpr() http.Handler { +func (r *Router) GetHandler() http.Handler { httpr := httprouter.New() for _, v := range r.routes { @@ -232,7 +232,6 @@ func handleReq(r *Router, handle Handle, m []Middleware) httprouter.Handle { } err := f(c) - if err != nil { r.ErrorHandler(c, err) }