Skip to content

Commit

Permalink
- update Locals function to accept interface{} key (#2144)
Browse files Browse the repository at this point in the history
- update Locals function to accept interface{} key (Requires new version of fasthttp)

Co-authored-by: rocketlaunchr-cto <rocketlaunchr.cloud@gmail.com>
  • Loading branch information
pjebs and rocketlaunchr-cto committed Oct 27, 2022
1 parent fd5045e commit ff46029
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ctx.go
Expand Up @@ -887,9 +887,9 @@ func (c *Ctx) Links(link ...string) {
bytebufferpool.Put(bb)
}

// Locals makes it possible to pass interface{} values under string keys scoped to the request
// Locals makes it possible to pass interface{} values under keys scoped to the request
// and therefore available to all following routes that match the request.
func (c *Ctx) Locals(key string, value ...interface{}) (val interface{}) {
func (c *Ctx) Locals(key interface{}, value ...interface{}) (val interface{}) {
if len(value) == 0 {
return c.fasthttp.UserValue(key)
}
Expand Down

0 comments on commit ff46029

Please sign in to comment.