MCPcopy Create free account
hub / github.com/chain/Core / ResponseWriter

Function ResponseWriter

net/http/httpjson/context.go:34–36  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

32// registered in this package is guaranteed to have
33// a response writer.
34func 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.

Callers 1

TestContextFunction · 0.85

Calls 1

ValueMethod · 0.45

Tested by 1

TestContextFunction · 0.68