Closed gopkg-dev closed 11 months ago
ContextKey is a string i assume and a string can never be nil in Go unless its an interface{}.
So strings in Go can never be nil, but only be a zero value to their concrete type which is an empty string.
Conclusion:
Invalid bug mark? plus invalid condition check; unnecessary or
operator (slightly more usage on memory (also not fitting innovation of fiber and fasthttp)
@ReneWerner87 correct if its wrong, thnx ^^
@Z3NTL3 pls check https://github.com/gofiber/fiber/pull/2731#issuecomment-1823236098
Bug Description
This is my fix:
https://github.com/gofiber/fiber/pull/2731
The fix checks if
cfg.ContextKey
is eithernil
or an empty string before assigning the default valueConfigDefault.ContextKey
. This ensures that theContextKey
is not missing or empty.How to Reproduce
Expected Behavior
...
Fiber Version
v2.51.0
Code Snippet (optional)
No response
Checklist: