(body interface{})
| 38 | } |
| 39 | |
| 40 | func JSONResponse(body interface{}) Responder { |
| 41 | return func(req *http.Request) (*http.Response, error) { |
| 42 | b, _ := json.Marshal(body) |
| 43 | return httpResponse(200, req, bytes.NewBuffer(b)), nil |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | func ErrorResponse() Responder { |
| 48 | return func(req *http.Request) (*http.Response, error) { |