MCPcopy
hub / github.com/stretchr/testify / Write

Method Write

http/test_response_writer.go:31–44  ·  view source on GitHub ↗

Deprecated: Use [net/http/httptest] instead.

(bytes []byte)

Source from the content-addressed store, hash-verified

29
30// Deprecated: Use [net/http/httptest] instead.
31func (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.
47func (rw *TestResponseWriter) WriteHeader(i int) {

Callers 2

generateCodeFunction · 0.80
httpReadBodyFunction · 0.80

Calls 1

WriteHeaderMethod · 0.95

Tested by 1

httpReadBodyFunction · 0.64