diff options
author | Alexander Neonxp Kiryukhin <i@neonxp.ru> | 2024-08-31 02:05:36 +0300 |
---|---|---|
committer | Alexander Neonxp Kiryukhin <i@neonxp.ru> | 2024-08-31 02:05:36 +0300 |
commit | 5094ebf213243023c6325310b3f710a0974025dd (patch) | |
tree | 98b501b07271645f924b70af00bf8792d6062d65 /middleware.go | |
parent | 376839b264c7f77b2540ad9f83bd8baf44063f17 (diff) |
Обновление muxv0.0.1
Diffstat (limited to 'middleware.go')
-rw-r--r-- | middleware.go | 8 |
1 files changed, 2 insertions, 6 deletions
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...) } |