Skip to content

Commit e6e98d0

Browse files
Tidy, update travis config.yml
1 parent 015365a commit e6e98d0

File tree

5 files changed

+33
-7
lines changed

5 files changed

+33
-7
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ language: go
22

33
go:
44
- 1.4
5+
- 1.5
6+
- 1.6
7+
- 1.7
58

69
before_install:
710
- go get github.com/axw/gocov/gocov

handler.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package handler
22

33
import (
4-
"context"
54
"encoding/json"
65
"io/ioutil"
76
"net/http"
87
"net/url"
98
"strings"
109

10+
"golang.org/x/net/context"
11+
1112
"github.com/graphql-go/graphql"
1213
)
1314

@@ -141,11 +142,6 @@ func (h *Handler) ContextHandler(ctx context.Context, w http.ResponseWriter, r *
141142
}
142143
}
143144

144-
// ServeHTTP provides an entrypoint into executing graphQL queries.
145-
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
146-
h.ContextHandler(r.Context(), w, r)
147-
}
148-
149145
type Config struct {
150146
Schema *graphql.Schema
151147
Pretty bool

handler_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package handler
22

33
import (
4-
"context"
54
"encoding/json"
65
"fmt"
76
"io/ioutil"
@@ -11,6 +10,8 @@ import (
1110
"strings"
1211
"testing"
1312

13+
"golang.org/x/net/context"
14+
1415
"github.com/graphql-go/graphql"
1516
"github.com/graphql-go/graphql/testutil"
1617
)

serve_http.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
// +build go1.7
3+
4+
package handler
5+
6+
import "net/http"
7+
8+
// ServeHTTP provides an entrypoint into executing graphQL queries.
9+
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
10+
h.ContextHandler(r.Context(), w, r)
11+
}

serve_http_legacy.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
// +build !go1.7
3+
4+
package handler
5+
6+
import (
7+
"net/http"
8+
9+
"golang.org/x/net/context"
10+
)
11+
12+
// ServeHTTP provides an entrypoint into executing graphQL queries.
13+
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
14+
h.ContextHandler(context.Background(), w, r)
15+
}

0 commit comments

Comments
 (0)