Closed DaryaHom closed 1 month ago
Using fasthttp.RequestCtx
is similar to working with a regular struct. Its fields should not be accessed concurrently, as access to them is not protected by a mutex.
It's recommended that you provide specific use cases, as offering generic solutions tends to be inefficient and already well-known.
I don't know what you want to do with the fasthttp.RequestCtx
, but normally you wouldn't really use this struct directly. I also wouldn't recommend using it as context.Context
. To be honest, I would recommend just using net/http
for whatever you want to do.
Hello! I am using fasthttp.RequestCtx. The documentation states that “It is unsafe modifying/reading RequestCtx instance from concurrently running goroutines.” I find this confirmed in my test. But maybe there is some safe use case if I need to run multiple goroutines? Please help me figure out how to fix this. Thank you
My code snippet:
The test:
Test result:
fasthttp version - v1.53.0
Actions for playback:
go generate ./...
go test ./... -count=1 -race