MCPcopy
hub / github.com/gorilla/mux / Write

Method Write

old_test.go:45–53  ·  view source on GitHub ↗

Write always succeeds and writes to rw.Body, if not nil.

(buf []byte)

Source from the content-addressed store, hash-verified

43
44// Write always succeeds and writes to rw.Body, if not nil.
45func (rw *ResponseRecorder) Write(buf []byte) (int, error) {
46 if rw.Body != nil {
47 rw.Body.Write(buf)
48 }
49 if rw.Code == 0 {
50 rw.Code = http.StatusOK
51 }
52 return len(buf), nil
53}
54
55// WriteHeader sets rw.Code.
56func (rw *ResponseRecorder) WriteHeader(code int) {

Calls

no outgoing calls

Tested by

no test coverage detected