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

Remove/cleanup request context helpers #525

Merged
merged 4 commits into from Oct 24, 2019

Conversation

fharding1
Copy link
Contributor

@fharding1 fharding1 commented Oct 24, 2019

Fixes nothing

Summary of Changes

  1. Removes context.go. Originally this was around so on Go < 1.7 we could use gorilla/context to "polyfill" context, but now that we've dropped support for that, I don't think it's necessary to have those helpers, plus it's nice to get rid of the (small) cognitive overhead of another file
  2. Renames the request context functions from the pattern setFoo to requestWithFoo, since I think this makes it a bit more clear that they're returning a request with a new context wrapping the old one, not changing the request
  3. Changes the request context functions to take concrete types instead of empty interfaces because there's no reason for them to take interfaces
  4. Moves the single test in context_test.go to mux_test.go since that seems to be testing the muxer itself anyways, not really the context implementation or anything

PS: Make sure your PR includes/updates tests! If you need help with this part, just ask!

@fharding1 fharding1 changed the title Rm context helpers Remove/cleanup request context helpers Oct 24, 2019
Mux doesn't build on Go < 1.7 so the comment doesn't really need to
clarify anymore.
@elithrar elithrar merged commit f395758 into gorilla:master Oct 24, 2019
@elithrar
Copy link
Contributor

Thanks!

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.

None yet

2 participants