leonklingele 167a8b5e94
🚀 Feature: Add and apply more stricter golangci-lint linting rules (#2286)
* golangci-lint: add and apply more stricter linting rules

* github: drop security workflow now that we use gosec linter inside golangci-lint

* github: use official golangci-lint CI linter

* Add editorconfig and gitattributes file
2023-01-27 09:01:37 +01:00

22 lines
392 B
Go

package skip
import (
"github.com/gofiber/fiber/v2"
)
// New creates a middleware handler which skips the wrapped handler
// if the exclude predicate returns true.
func New(handler fiber.Handler, exclude func(c *fiber.Ctx) bool) fiber.Handler {
if exclude == nil {
return handler
}
return func(c *fiber.Ctx) error {
if exclude(c) {
return c.Next()
}
return handler(c)
}
}