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

Request and Writer Getters in Context #2281

Closed
wants to merge 2 commits into from
Closed

Conversation

SPie
Copy link

@SPie SPie commented Mar 9, 2020

I added getter functions for the Request and Writer field in Context.
With these changes, it will be easier to create an interface for Context in a project using gin and because of this, easier to mock.

@codecov
Copy link

codecov bot commented Mar 9, 2020

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2281   +/-   ##
=======================================
  Coverage   98.38%   98.39%           
=======================================
  Files          41       41           
  Lines        2296     2300    +4     
=======================================
+ Hits         2259     2263    +4     
  Misses         21       21           
  Partials       16       16           
Impacted Files Coverage Δ
context.go 98.05% <100.00%> (+0.01%) ⬆️

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 a71af9c...b4744d3. Read the comment docs.

@appleboy
Copy link
Member

@SPie Please give the more example?

@SPie
Copy link
Author

SPie commented Mar 17, 2020

@appleboy For example, I use a library with a function which needs a http.Request and because I want to use an Interface for gin.Context I would need to have a an interface function to get the Request out of the Context.

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

Successfully merging this pull request may close these issues.

2 participants