Skip to content

Updated to use Go 1.7 request based context#17

Closed
nicholasjackson wants to merge 1 commit into
graphql-go:masterfrom
notonthehighstreet:master
Closed

Updated to use Go 1.7 request based context#17
nicholasjackson wants to merge 1 commit into
graphql-go:masterfrom
notonthehighstreet:master

Conversation

@nicholasjackson
Copy link
Copy Markdown

@nicholasjackson nicholasjackson commented Nov 1, 2016

Since context has been merged as stable in Go 1.7 and is now part of the request object (https://godoc.org/net/http#Request)[https://godoc.org/net/http#Request]. This pull request modifies the behavior of the ServeHTTP method to use the request.Context() on go 1.7. Backward compatibility is preserved for version less than 1.7 by using build constraints.

I have also refactored the tests a little removing the TODO and adding a specific test for Go 1.7 context in the request.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.05%) to 94.393% when pulling e6e98d0 on notonthehighstreet:master into 52e6de4 on graphql-go:master.

Restored interface for backward compatibility

Tidy, update travis config.yml

Added test for Go 1.7 context
@coveralls
Copy link
Copy Markdown

coveralls commented Nov 1, 2016

Coverage Status

Coverage increased (+0.1%) to 94.545% when pulling 49e51bc on notonthehighstreet:master into 52e6de4 on graphql-go:master.

hallettj pushed a commit to InVisionApp/handler that referenced this pull request Dec 29, 2016
@mbertschler
Copy link
Copy Markdown

mbertschler commented Jul 23, 2017

Now that this change was applied in the https://github.com/graphql-go/graphql library in this PR: graphql-go/graphql#214 , can it also be merged here? Thanks!

@chris-ramon
Copy link
Copy Markdown
Member

closing this one in favor of #23 — thanks a lot @nicholasjackson! 👍

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.

4 participants