Write always succeeds and writes to rw.Body, if not nil.
(buf []byte)
| 43 | |
| 44 | // Write always succeeds and writes to rw.Body, if not nil. |
| 45 | func (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. |
| 56 | func (rw *ResponseRecorder) WriteHeader(code int) { |
no outgoing calls
no test coverage detected