Skip to content

Commit

Permalink
minor update to test cases for latest go versions
Browse files Browse the repository at this point in the history
  • Loading branch information
pkieltyka committed Jan 8, 2019
1 parent ac43d9a commit 1e100be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
language: go

go:
- 1.7.x
- 1.8.x
- tip
- 1.9.x
- 1.10.x
- 1.11.x

install:
- go get -u golang.org/x/tools/cmd/goimports
Expand Down
13 changes: 7 additions & 6 deletions docgen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ func hubIndexHandler(w http.ResponseWriter, r *http.Request) {

// Generate docs for the MuxBig from chi/mux_test.go
func TestMuxBig(t *testing.T) {
var r, sr1, sr2, sr3, sr4, sr5, sr6 *chi.Mux
// var sr1, sr2, sr3, sr4, sr5, sr6 *chi.Mux
var r, sr3 *chi.Mux
r = chi.NewRouter()
r.Use(RequestID)

Expand Down Expand Up @@ -85,14 +86,14 @@ func TestMuxBig(t *testing.T) {
})

r.Route("/hubs", func(r chi.Router) {
sr1 = r.(*chi.Mux)
_ = r.(*chi.Mux) // sr1
r.Use(func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
next.ServeHTTP(w, r)
})
})
r.Route("/{hubID}", func(r chi.Router) {
sr2 = r.(*chi.Mux)
_ = r.(*chi.Mux) // sr2
r.Get("/", hubIndexHandler)
r.Get("/touch", func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
Expand All @@ -109,7 +110,7 @@ func TestMuxBig(t *testing.T) {
w.Write([]byte(s))
})
sr3.Route("/{webhookID}", func(r chi.Router) {
sr4 = r.(*chi.Mux)
_ = r.(*chi.Mux) // sr4
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
s := fmt.Sprintf("/hubs/%s/webhooks/%s reqid:%s session:%s", chi.URLParam(r, "hubID"),
Expand Down Expand Up @@ -137,7 +138,7 @@ func TestMuxBig(t *testing.T) {
// routes

r.Route("/posts", func(r chi.Router) {
sr5 = r.(*chi.Mux)
_ = r.(*chi.Mux) // sr5
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
s := fmt.Sprintf("/hubs/%s/posts reqid:%s session:%s", chi.URLParam(r, "hubID"),
Expand All @@ -149,7 +150,7 @@ func TestMuxBig(t *testing.T) {
})

r.Route("/folders/", func(r chi.Router) {
sr6 = r.(*chi.Mux)
_ = r.(*chi.Mux) // sr6
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
s := fmt.Sprintf("/folders/ reqid:%s session:%s",
Expand Down

0 comments on commit 1e100be

Please sign in to comment.