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

Bump module version to v3 (again) now that support is backported #364

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
language: go

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

install:
- go get -u golang.org/x/tools/cmd/goimports
- GO111MODULE=off go get -u golang.org/x/tools/cmd/goimports

env:
- GO111MODULE=on

script:
- go get -d -t ./...
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ package main

import (
"net/http"
"github.com/go-chi/chi"
"github.com/go-chi/chi/v3"
)

func main() {
Expand All @@ -77,8 +77,8 @@ of chi and serve as a good form of documentation.
import (
//...
"context"
"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"github.com/go-chi/chi/v3"
"github.com/go-chi/chi/v3/middleware"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion _examples/custom-handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"net/http"

"github.com/go-chi/chi"
"github.com/go-chi/chi/v3"
)

type Handler func(w http.ResponseWriter, r *http.Request) error
Expand Down
4 changes: 2 additions & 2 deletions _examples/custom-method/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import (
"net/http"

"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"github.com/go-chi/chi/v3"
"github.com/go-chi/chi/v3/middleware"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion _examples/fileserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"path/filepath"
"strings"

"github.com/go-chi/chi"
"github.com/go-chi/chi/v3"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions _examples/graceful/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"os/signal"
"time"

"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"github.com/go-chi/chi/v3"
"github.com/go-chi/chi/v3/middleware"
"github.com/go-chi/valve"
)

Expand Down
4 changes: 2 additions & 2 deletions _examples/hello-world/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import (
"net/http"

"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"github.com/go-chi/chi/v3"
"github.com/go-chi/chi/v3/middleware"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions _examples/limits/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"net/http"
"time"

"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"github.com/go-chi/chi/v3"
"github.com/go-chi/chi/v3/middleware"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions _examples/logging/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"net/http"
"time"

"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"github.com/go-chi/chi/v3"
"github.com/go-chi/chi/v3/middleware"
"github.com/sirupsen/logrus"
)

Expand Down
6 changes: 3 additions & 3 deletions _examples/rest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ import (
"net/http"
"strings"

"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"github.com/go-chi/chi/v3"
"github.com/go-chi/chi/v3/middleware"
"github.com/go-chi/docgen"
"github.com/go-chi/render"
)
Expand Down Expand Up @@ -105,7 +105,7 @@ func main() {
if *routes {
// fmt.Println(docgen.JSONRoutesDoc(r))
fmt.Println(docgen.MarkdownRoutesDoc(r, docgen.MarkdownOpts{
ProjectPath: "github.com/go-chi/chi",
ProjectPath: "github.com/go-chi/chi/v3",
Intro: "Welcome to the chi/_examples/rest generated docs.",
}))
return
Expand Down
2 changes: 1 addition & 1 deletion _examples/router-walk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net/http"

"github.com/go-chi/chi"
"github.com/go-chi/chi/v3"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions _examples/todos-resource/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ package main
import (
"net/http"

"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"github.com/go-chi/chi/v3"
"github.com/go-chi/chi/v3/middleware"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion _examples/todos-resource/todos.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"net/http"

"github.com/go-chi/chi"
"github.com/go-chi/chi/v3"
)

type todosResource struct{}
Expand Down
2 changes: 1 addition & 1 deletion _examples/todos-resource/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"net/http"

"github.com/go-chi/chi"
"github.com/go-chi/chi/v3"
)

type usersResource struct{}
Expand Down
24 changes: 12 additions & 12 deletions _examples/versions/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (
"net/http"
"time"

"github.com/go-chi/chi"
"github.com/go-chi/chi/_examples/versions/data"
"github.com/go-chi/chi/_examples/versions/presenter/v1"
"github.com/go-chi/chi/_examples/versions/presenter/v2"
"github.com/go-chi/chi/_examples/versions/presenter/v3"
"github.com/go-chi/chi/middleware"
"github.com/go-chi/chi/v3"
"github.com/go-chi/chi/v3/_examples/versions/data"
"github.com/go-chi/chi/v3/_examples/versions/presenter/apiv1"
"github.com/go-chi/chi/v3/_examples/versions/presenter/apiv2"
"github.com/go-chi/chi/v3/_examples/versions/presenter/apiv3"
"github.com/go-chi/chi/v3/middleware"
"github.com/go-chi/render"
)

Expand Down Expand Up @@ -88,11 +88,11 @@ func listArticles(w http.ResponseWriter, r *http.Request) {
apiVersion := r.Context().Value("api.version").(string)
switch apiVersion {
case "v1":
articles <- v1.NewArticleResponse(article)
articles <- apiv1.NewArticleResponse(article)
case "v2":
articles <- v2.NewArticleResponse(article)
articles <- apiv2.NewArticleResponse(article)
default:
articles <- v3.NewArticleResponse(article)
articles <- apiv3.NewArticleResponse(article)
}

time.Sleep(100 * time.Millisecond)
Expand Down Expand Up @@ -133,11 +133,11 @@ func getArticle(w http.ResponseWriter, r *http.Request) {
apiVersion := r.Context().Value("api.version").(string)
switch apiVersion {
case "v1":
payload = v1.NewArticleResponse(article)
payload = apiv1.NewArticleResponse(article)
case "v2":
payload = v2.NewArticleResponse(article)
payload = apiv2.NewArticleResponse(article)
default:
payload = v3.NewArticleResponse(article)
payload = apiv3.NewArticleResponse(article)
}

render.Render(w, r, payload)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package v1
package apiv1

import (
"net/http"

"github.com/go-chi/chi/_examples/versions/data"
"github.com/go-chi/chi/v3/_examples/versions/data"
)

// Article presented in API version 1.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package v2
package apiv2

import (
"fmt"
"net/http"

"github.com/go-chi/chi/_examples/versions/data"
"github.com/go-chi/chi/v3/_examples/versions/data"
)

// Article presented in API version 2.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package v3
package apiv3

import (
"fmt"
"math/rand"
"net/http"

"github.com/go-chi/chi/_examples/versions/data"
"github.com/go-chi/chi/v3/_examples/versions/data"
)

// Article presented in API version 2.
Expand Down
4 changes: 2 additions & 2 deletions chi.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// import (
// "net/http"
//
// "github.com/go-chi/chi"
// "github.com/go-chi/chi/middleware"
// "github.com/go-chi/chi/v3"
// "github.com/go-chi/chi/v3/middleware"
// )
//
// func main() {
Expand Down
6 changes: 6 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module github.com/go-chi/chi/v3

require (
golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3
golang.org/x/text v0.3.0 // indirect
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3 h1:dgd4x4kJt7G4k4m93AYLzM8Ni6h2qLTfh9n9vXJT3/0=
golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
2 changes: 1 addition & 1 deletion middleware/content_charset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http/httptest"
"testing"

"github.com/go-chi/chi"
"github.com/go-chi/chi/v3"
)

func TestContentCharset(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion middleware/get_head.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package middleware
import (
"net/http"

"github.com/go-chi/chi"
"github.com/go-chi/chi/v3"
)

// GetHead automatically route undefined HEAD requests to GET handlers.
Expand Down
2 changes: 1 addition & 1 deletion middleware/get_head_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http/httptest"
"testing"

"github.com/go-chi/chi"
"github.com/go-chi/chi/v3"
)

func TestGetHead(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion middleware/profiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"
"net/http/pprof"

"github.com/go-chi/chi"
"github.com/go-chi/chi/v3"
)

// Profiler is a convenient subrouter used for mounting net/http/pprof. ie.
Expand Down
2 changes: 1 addition & 1 deletion middleware/realip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http/httptest"
"testing"

"github.com/go-chi/chi"
"github.com/go-chi/chi/v3"
)

func TestXRealIP(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion middleware/strip.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package middleware
import (
"net/http"

"github.com/go-chi/chi"
"github.com/go-chi/chi/v3"
)

// StripSlashes is a middleware that will match request paths with a trailing
Expand Down
2 changes: 1 addition & 1 deletion middleware/strip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http/httptest"
"testing"

"github.com/go-chi/chi"
"github.com/go-chi/chi/v3"
)

func TestStripSlashes(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion middleware/throttle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"
"time"

"github.com/go-chi/chi"
"github.com/go-chi/chi/v3"
)

var testContent = []byte("Hello world!")
Expand Down
2 changes: 1 addition & 1 deletion middleware/url_format.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"strings"

"github.com/go-chi/chi"
"github.com/go-chi/chi/v3"
)

var (
Expand Down