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

compare decoded go struct for request body #1876

Merged
merged 1 commit into from May 26, 2021

Conversation

willnorris
Copy link
Collaborator

The use of cmp.AllowUnexported stuck out to me as code smell when reviewing #1875, but since the weird comparison was already there, I decided to leave it alone in that PR.

This was a very weird test method, since it doesn't follow the pattern of the rest of go-github for comparing POST request bodies, and as a result makes things way more complicated than they need to be.

This eliminates the GetReadWriter and GetReadCloser funcs. There was discussion in #1238 about these potentially being general purpose funcs, but they never ended up being used beyond this one method, nor should they ever be necessary I don't think. Even though these were exported funcs, because they were only defined in the test package, this shouldn't be a breaking change.

@google-cla google-cla bot added the cla: yes Indication that the PR author has signed a Google Contributor License Agreement. label May 26, 2021
@codecov
Copy link

codecov bot commented May 26, 2021

Codecov Report

Merging #1876 (17fb4ff) into master (51e7595) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1876   +/-   ##
=======================================
  Coverage   97.65%   97.65%           
=======================================
  Files         105      105           
  Lines        6783     6783           
=======================================
  Hits         6624     6624           
  Misses         86       86           
  Partials       73       73           

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 51e7595...17fb4ff. Read the comment docs.

@willnorris willnorris requested a review from gmlewis May 26, 2021 19:31
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @willnorris !
LGTM.

@willnorris willnorris changed the title compare underlying byte slice rather than io.ReadCloser compare decoded go struct for request body May 26, 2021
@willnorris willnorris merged commit 8b2866e into google:master May 26, 2021
@willnorris willnorris deleted the readcloser branch May 26, 2021 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indication that the PR author has signed a Google Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants