ResponseWriter returns the HTTP response writer stored in ctx. If there is none, it panics. The context given to a handler function registered in this package is guaranteed to have a response writer.
(ctx context.Context)
| 32 | // registered in this package is guaranteed to have |
| 33 | // a response writer. |
| 34 | func ResponseWriter(ctx context.Context) http.ResponseWriter { |
| 35 | return ctx.Value(respKey).(http.ResponseWriter) |
| 36 | } |
| 37 | |
| 38 | // WithRequest returns a context with an HTTP request stored in it. |
| 39 | // It is useful for testing. |