diff --git a/middleware/compress.go b/middleware/compress.go index 264e7f26..7628543e 100644 --- a/middleware/compress.go +++ b/middleware/compress.go @@ -4,8 +4,8 @@ import ( "fmt" "log" - "github.com/gofiber/fiber" - "github.com/valyala/fasthttp" + fiber "github.com/gofiber/fiber" + fasthttp "github.com/valyala/fasthttp" ) // CompressConfig defines the config for Compress middleware. @@ -67,16 +67,16 @@ func CompressWithConfig(config CompressConfig) fiber.Handler { func compress(config CompressConfig) fiber.Handler { // Init middleware settings - var compress fasthttp.RequestHandler + var compressHandler fasthttp.RequestHandler switch config.Level { case -1: // Disabled - compress = fasthttp.CompressHandlerBrotliLevel(func(c *fasthttp.RequestCtx) {}, fasthttp.CompressBrotliNoCompression, fasthttp.CompressNoCompression) + compressHandler = fasthttp.CompressHandlerBrotliLevel(func(c *fasthttp.RequestCtx) {}, fasthttp.CompressBrotliNoCompression, fasthttp.CompressNoCompression) case 1: // Best speed - compress = fasthttp.CompressHandlerBrotliLevel(func(c *fasthttp.RequestCtx) {}, fasthttp.CompressBrotliBestSpeed, fasthttp.CompressBestSpeed) + compressHandler = fasthttp.CompressHandlerBrotliLevel(func(c *fasthttp.RequestCtx) {}, fasthttp.CompressBrotliBestSpeed, fasthttp.CompressBestSpeed) case 2: // Best compression - compress = fasthttp.CompressHandlerBrotliLevel(func(c *fasthttp.RequestCtx) {}, fasthttp.CompressBrotliBestCompression, fasthttp.CompressBestCompression) + compressHandler = fasthttp.CompressHandlerBrotliLevel(func(c *fasthttp.RequestCtx) {}, fasthttp.CompressBrotliBestCompression, fasthttp.CompressBestCompression) default: // Default - compress = fasthttp.CompressHandlerBrotliLevel(func(c *fasthttp.RequestCtx) {}, fasthttp.CompressBrotliDefaultCompression, fasthttp.CompressDefaultCompression) + compressHandler = fasthttp.CompressHandlerBrotliLevel(func(c *fasthttp.RequestCtx) {}, fasthttp.CompressBrotliDefaultCompression, fasthttp.CompressDefaultCompression) } // Return handler return func(c *fiber.Ctx) { @@ -88,6 +88,6 @@ func compress(config CompressConfig) fiber.Handler { // Middleware logic... c.Next() // Compress response - compress(c.Fasthttp) + compressHandler(c.Fasthttp) } } diff --git a/middleware/filesystem.go b/middleware/filesystem.go index e6d0c682..372b507b 100644 --- a/middleware/filesystem.go +++ b/middleware/filesystem.go @@ -10,7 +10,7 @@ import ( "sort" "strings" - "github.com/gofiber/fiber" + fiber "github.com/gofiber/fiber" ) // Middleware types diff --git a/middleware/logger.go b/middleware/logger.go index 6e86bdf6..87beb496 100644 --- a/middleware/logger.go +++ b/middleware/logger.go @@ -11,9 +11,9 @@ import ( "sync" "time" - "github.com/gofiber/fiber" - "github.com/gofiber/utils" - "github.com/valyala/bytebufferpool" + fiber "github.com/gofiber/fiber" + utils "github.com/gofiber/utils" + bytebufferpool "github.com/valyala/bytebufferpool" ) // Middleware types diff --git a/middleware/request_id.go b/middleware/request_id.go index c65519cc..58771fa6 100644 --- a/middleware/request_id.go +++ b/middleware/request_id.go @@ -4,8 +4,8 @@ import ( "fmt" "log" - "github.com/gofiber/fiber" - "github.com/gofiber/utils" + fiber "github.com/gofiber/fiber" + utils "github.com/gofiber/utils" ) // Middleware types