Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking for nil response before closing it. #1601

Open
wants to merge 4 commits into
base: master
from

Conversation

@kingbhanu
Copy link

kingbhanu commented Aug 13, 2020

Closing nil response will throw a panic so added a nil check before calling accessing resp object, defer function will be called even if there will be an error in response.

kingbhanu added 2 commits Aug 13, 2020
Checking for nil response before closing it.
@google-cla
Copy link

google-cla bot commented Aug 13, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Aug 13, 2020
@google-cla
Copy link

google-cla bot commented Aug 13, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

Reformatted the code.
@google-cla
Copy link

google-cla bot commented Aug 13, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@codecov
Copy link

codecov bot commented Aug 13, 2020

Codecov Report

Merging #1601 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1601   +/-   ##
=======================================
  Coverage   67.98%   67.99%           
=======================================
  Files          96       96           
  Lines        8772     8773    +1     
=======================================
+ Hits         5964     5965    +1     
  Misses       1898     1898           
  Partials      910      910           
Impacted Files Coverage Δ
github/github.go 89.93% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e19d4dd...85c534e. Read the comment docs.

@kingbhanu
Copy link
Author

kingbhanu commented Aug 13, 2020

@googlebot I signed it!

@google-cla google-cla bot added cla: yes and removed cla: no labels Aug 13, 2020
Copy link
Collaborator

gmlewis left a comment

Thank you, @kingbhanu !
Please add a unit test for this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.