(body interface{})
| 51 | } |
| 52 | |
| 53 | func ErrorResponseWithBody(body interface{}) Responder { |
| 54 | return func(req *http.Request) (*http.Response, error) { |
| 55 | b, _ := json.Marshal(body) |
| 56 | return httpResponse(400, req, bytes.NewBuffer(b)), nil |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | func httpResponse(status int, req *http.Request, body io.Reader) *http.Response { |
| 61 | return &http.Response{ |