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

feat: add nil check to SetResult (#503) #582

Merged
merged 1 commit into from Mar 6, 2023

Conversation

tkrop
Copy link
Contributor

@tkrop tkrop commented Sep 21, 2022

fixes #503.

Simply adds a nil check to SetResult to ensure that it can be used fluently. Also adds a simple unit test to ensure that the current panic will not happen any longer.

@@ -303,7 +303,9 @@ func (r *Request) SetBody(body interface{}) *Request {
// Accessing a result value from response instance.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this should be documented here? something like
passing a nil res paramaeter has no effect

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@segevda I will add it later it. Thanks!

@jeevatkm jeevatkm added this to the v2.8.0 Milestone milestone Mar 6, 2023
@codecov
Copy link

codecov bot commented Mar 6, 2023

Codecov Report

Merging #582 (c1bb66c) into master (dc65180) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #582   +/-   ##
=======================================
  Coverage   95.84%   95.85%           
=======================================
  Files          10       10           
  Lines        1325     1326    +1     
=======================================
+ Hits         1270     1271    +1     
  Misses         34       34           
  Partials       21       21           
Impacted Files Coverage Δ
request.go 95.27% <100.00%> (+0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jeevatkm jeevatkm merged commit 840c825 into go-resty:master Mar 6, 2023
@tkrop tkrop deleted the add-nil-check branch July 5, 2023 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

SetResult Add nil Check
3 participants