7 // TestResponseWriter DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead.
8 type TestResponseWriter struct {
10 // StatusCode is the last int written by the call to WriteHeader(int)
13 // Output is a string containing the written bytes using the Write([]byte) func.
16 // header is the internal storage of the http.Header object
20 // Header DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead.
21 func (rw *TestResponseWriter) Header() http.Header {
24 rw.header = make(http.Header)
30 // Write DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead.
31 func (rw *TestResponseWriter) Write(bytes []byte) (int, error) {
33 // assume 200 success if no header has been set
34 if rw.StatusCode == 0 {
38 // add these bytes to the output string
39 rw.Output = rw.Output + string(bytes)
41 // return normal values
46 // WriteHeader DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead.
47 func (rw *TestResponseWriter) WriteHeader(i int) {