Conditions | 2 |
Total Lines | 10 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 2.0625 |
Changes | 0 |
1 | package devto |
||
16 | func unmarshalErrorResponse(res *http.Response) error { |
||
17 | 1 | var e ErrorResponse |
|
18 | 1 | if err := json.NewDecoder(res.Body).Decode(&e); err != nil { |
|
19 | return fmt.Errorf( |
||
20 | `unexpected error deserializing %d response: "%v"`, |
||
21 | res.StatusCode, |
||
22 | err, |
||
23 | ) |
||
24 | } |
||
25 | 1 | return &e |
|
26 | } |
||
36 |