Commit Graph

12 Commits

Author SHA1 Message Date
Erik Dubbelboer c2b317d47d Go 1.26 and golangci-lint updates (#2146)
Keep Go 1.24 compatibility for now (by not using `wg.Go()`).
2026-02-21 10:28:39 +01:00
Erik Dubbelboer 0324e8d2a2 Make sure removed/resetted user valeus get garbage collected
Since our userData slice isn't shrunk when we delete values, it can
still keep pointing to things that have been removed. Set these pointers
to nil so that the key and value can be garbage collected.

Fixes https://github.com/valyala/fasthttp/issues/1812
2024-07-28 11:06:17 +02:00
Oleksandr Redko 3166afd835 Enable few gocritic checks; fix up issues (#1728) 2024-03-02 16:19:05 +01:00
Oleksandr Redko f196617f55 chore: Use 'any' instead of 'interface{}' (#1666)
gofmt -w -r "interface{} -> any" -l .
2023-11-24 11:33:04 +01:00
Oleksandr Redko 9aa666e814 Enable gocritic linter; fix lint issues (#1612) 2023-08-29 20:08:37 +02:00
pj d404f2db91 make RequestCtx's userdata accept keys that are of type: interface{} (#1387)
Co-authored-by: rocketlaunchr-cto <rocketlaunchr.cloud@gmail.com>
2022-10-06 16:25:32 +02:00
Erik Dubbelboer 9961079196 Fix userdata re-use after Remove
See also: https://github.com/valyala/fasthttp/pull/1298
2022-05-11 16:11:18 +02:00
tyltr 7fdd5261e8 feat: a new userData API Remove (#1117)
* feat:userData new api "delete"

* ctx api `remove`

* rename

* modify
2021-10-08 17:45:45 +02:00
tyltr f307299246 feat:no need to store nil (#1116)
* feat:no  need  to  store nil

* lint
2021-10-06 18:03:16 +02:00
Aliaksandr Valialkin 0d43464f64 Renamed unsafeBytes2Str to b2s 2016-03-29 16:26:21 +03:00
Aliaksandr Valialkin eafcb74ce5 Call Close on user values stored via RequestCtx.SetUserValue if these values implement io.Closer 2016-02-05 12:50:58 +02:00
Aliaksandr Valialkin b00a213a93 Moved ctx.UserValue from standard map to custom userData. This should improve its' performance for common case when ctx contains up to 10 user values 2015-12-11 16:40:55 +02:00