I believe netContext.Context should be embedded in echo.Context instead of being a field, and context.Value() should call context.Set().
I think it would be much more interesting if echo.Context were compatible with context.Context :
- Mocking context would be much much simpler (instead of having to implement our own 47 method Context Interface)
- If needed we could create functions that receive a
context.Context and pass them either echo.Context for real code, either a context.Context when testing. Again, super easy to test.
- Decoupling Echo from the rest of the application that doesn't necessarily need to be bound to a specific framework.
I believe
netContext.Contextshould be embedded inecho.Contextinstead of being a field, andcontext.Value()should callcontext.Set().I think it would be much more interesting if
echo.Contextwere compatible withcontext.Context:context.Contextand pass them eitherecho.Contextfor real code, either acontext.Contextwhen testing. Again, super easy to test.