Skip to content

Commit

Permalink
docs: Improve ctx.Locals method documentation (#3033)
Browse files Browse the repository at this point in the history
  • Loading branch information
sixcolors authored Jun 12, 2024
1 parent 6c9510d commit 232c0fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,10 @@ func (c *Ctx) Links(link ...string) {

// 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.
//
// All the values are removed from ctx after returning from the top
// RequestHandler. Additionally, Close method is called on each value
// implementing io.Closer before removing the value from ctx.
func (c *Ctx) Locals(key interface{}, value ...interface{}) interface{} {
if len(value) == 0 {
return c.fasthttp.UserValue(key)
Expand Down

0 comments on commit 232c0fa

Please sign in to comment.