-
Couldn't load subscription status.
- Fork 62
avoid O(N) and fix defer reader close #180
Conversation
Signed-off-by: Antonio Murdaca <[email protected]>
| if err != nil { | ||
| return nil, nil, err | ||
| } | ||
| defer res.Body.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that the original res doesn't get closed if this if block gets dropped into. Would you mind adding a res.Body.Close() around like 507 while you're here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a problem however, response body closing is an issue in all of this routine in case of any errors during the function, I'll add a defer
|
LGTM |
|
@dgonyeo reworked the second commit so that if there's an error and the |
| } | ||
|
|
||
| defer func() { | ||
| if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just "and" those to save indentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to and
|
One nit but LGTM afterwards. |
Signed-off-by: Antonio Murdaca <[email protected]>
|
Thanks! |
Uh oh!
There was an error while loading. Please reload this page.