diff --git a/.travis.yml b/.travis.yml index 1e9522a..d36f9b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ jobs: include: - stage: lint script: - - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.39.0 + - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.40.1 - golangci-lint run - stage: cross compilation diff --git a/router.go b/router.go index 111587f..d9cbab5 100644 --- a/router.go +++ b/router.go @@ -106,7 +106,9 @@ func (r *Router) getGroupFullPath(path string) string { func (r *Router) handler(fn View, middle Middlewares) fasthttp.RequestHandler { middle = r.buildMiddlewares(middle) - chain := append(middle.Before, func(ctx *RequestCtx) error { + chain := make([]Middleware, 0) + chain = append(chain, middle.Before...) + chain = append(chain, func(ctx *RequestCtx) error { if !ctx.skipView { if err := fn(ctx); err != nil { return err