fix append (different behaviour in arm)

This commit is contained in:
Nazar Kanaev 2022-06-01 20:51:00 +01:00
parent 5e46f1480e
commit cba3fbc48c

View File

@ -32,10 +32,13 @@ func (r *Router) Use(h Handler) {
} }
func (r *Router) For(path string, handler Handler) { func (r *Router) For(path string, handler Handler) {
chain := make([]Handler, 0)
chain = append(chain, r.middle...)
chain = append(chain, handler)
x := Route{} x := Route{}
x.regex = routeRegexp(path) x.regex = routeRegexp(path)
x.chain = append(r.middle, handler) x.chain = chain
r.routes = append(r.routes, x) r.routes = append(r.routes, x)
} }