NewErrorResponse is a shortcut for creating an error response for a single error.
(message string, code int)
| 201 | // NewErrorResponse is a shortcut for creating an error response for a |
| 202 | // single error. |
| 203 | func NewErrorResponse(message string, code int) Response { |
| 204 | return Response{ |
| 205 | Success: false, |
| 206 | Result: nil, |
| 207 | Errors: []ResponseMessage{{code, message}}, |
| 208 | Messages: []ResponseMessage{}, |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | // SendResponse builds a response from the result, sets the JSON |
| 213 | // header, and writes to the http.ResponseWriter. |
no outgoing calls
no test coverage detected
searching dependent graphs…