You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bodyclose is happy with the above program and won't show any errors. But in reality, the above program will cause a resource leak as resp.Body.Close() is not being called in places outside the if condition.
It is safe to generalize that, whenever a branch occurs in the code like an if or switch, then bodyclose could look at all the branches to check if the resp.Body.Close() is called.
The text was updated successfully, but these errors were encountered:
ma91n
linked a pull request
Sep 9, 2024
that will
close
this issue
Consider the program:
bodyclose is happy with the above program and won't show any errors. But in reality, the above program will cause a resource leak as
resp.Body.Close()
is not being called in places outside theif
condition.It is safe to generalize that, whenever a branch occurs in the code like an
if
orswitch
, thenbodyclose
could look at all the branches to check if theresp.Body.Close()
is called.The text was updated successfully, but these errors were encountered: