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

handle nil body for JSON binding #1638

Merged
merged 2 commits into from
Nov 22, 2018
Merged

Conversation

mllu
Copy link
Contributor

@mllu mllu commented Nov 11, 2018

  • With pull requests:
    • Open your pull request against master
    • Your pull request should have no more than two commits, if not you should squash them.
    • It should pass all tests in the available continuous integrations systems such as TravisCI.
    • You should add/modify tests to cover your proposed code changes.
    • If your pull request contains a new feature, please document it on the README.

In the real world, it probably shouldn't matter. It just happened when I forgot to pass body to http.NewRequest and the function Bind panicked under that situation.

If we always assume body will not be nil, please let me know, I will close this PR. Thank you.

@codecov
Copy link

codecov bot commented Nov 11, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@521d06c). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1638   +/-   ##
=========================================
  Coverage          ?   99.29%           
=========================================
  Files             ?       40           
  Lines             ?     1973           
  Branches          ?        0           
=========================================
  Hits              ?     1959           
  Misses            ?       10           
  Partials          ?        4
Impacted Files Coverage Δ
binding/json.go 100% <100%> (ø)

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 521d06c...1c21314. Read the comment docs.

@appleboy appleboy added the bug label Nov 22, 2018
@appleboy appleboy added this to the 1.4 milestone Nov 22, 2018
@appleboy
Copy link
Member

@thinkerou need your review.

@thinkerou thinkerou merged commit 64457fb into gin-gonic:master Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants