Skip to content

Commit 5ab92b7

Browse files
committed
no need to check for v nil
1 parent 92edc64 commit 5ab92b7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

internal/mbhttp/client.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@ func (c *Client) Do(req *http.Request, v interface{}) (*http.Response, error) {
5656
}
5757
return nil, errors.Errorf("%s: %s", c.boxname, o.Error)
5858
}
59-
if v == nil {
60-
if err := json.Unmarshal(b, &v); err != nil {
61-
return nil, errors.Wrap(err, "decode response data")
62-
}
59+
if err := json.Unmarshal(b, &v); err != nil {
60+
return nil, errors.Wrap(err, "decode response data")
6361
}
62+
6463
return resp, nil
6564
}

0 commit comments

Comments
 (0)