Deprecated: Use [net/http/httptest] instead.
(bytes []byte)
| 29 | |
| 30 | // Deprecated: Use [net/http/httptest] instead. |
| 31 | func (rw *TestResponseWriter) Write(bytes []byte) (int, error) { |
| 32 | |
| 33 | // assume 200 success if no header has been set |
| 34 | if rw.StatusCode == 0 { |
| 35 | rw.WriteHeader(200) |
| 36 | } |
| 37 | |
| 38 | // add these bytes to the output string |
| 39 | rw.Output += string(bytes) |
| 40 | |
| 41 | // return normal values |
| 42 | return 0, nil |
| 43 | |
| 44 | } |
| 45 | |
| 46 | // Deprecated: Use [net/http/httptest] instead. |
| 47 | func (rw *TestResponseWriter) WriteHeader(i int) { |