mirror of
https://github.com/gofiber/fiber.git
synced 2025-05-30 19:33:01 +00:00
* Add type-specific local value handling with generics in Ctx Introduced a new function, Locals, that utilizes Go's generics to handle and retrieve type-specific local values within a request context. This enhancement provides more accurate data type control within the context. Included are tests for generic and custom struct use-cases to ensure the function performs as expected. * Update documentation for Go generics in Locals method Added documentation to explain the new version of the Locals method that uses Go's generics feature. This version allows for better control of data types when manipulating and retrieving local values within a request's context. Examples are provided, along with a caution on using correct data types to prevent a runtime panic. * update ctx.md * Correct indentation in API documentation * Refactor Locals function and add new test case * Refactor Locals function and add new test case --------- Co-authored-by: Deza Farras Tsany <deza.ftsany@gmail.com>