From 5094ebf213243023c6325310b3f710a0974025dd Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Sat, 31 Aug 2024 02:05:36 +0300 Subject: Обновление mux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- middleware.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'middleware.go') diff --git a/middleware.go b/middleware.go index 2b56105..7892966 100644 --- a/middleware.go +++ b/middleware.go @@ -4,10 +4,6 @@ import "net/http" type Middleware func(http.Handler) http.Handler -func Use(handler http.Handler, middlewares ...Middleware) http.Handler { - for _, h := range middlewares { - handler = h(handler) - } - - return handler +func (m *Mux) Use(middlewares ...Middleware) { + m.middlewares = append(m.middlewares, middlewares...) } -- cgit v1.2.3