Skip to content

Commit

Permalink
add go.mod, assuming current master is a v3 branch
Browse files Browse the repository at this point in the history
Import paths are changed according to Semantic Import Versions rationale.
Otherwise `vgo test ./middleware` fails bacause of import path interpretation - it assumes
that "github.com/go-chi/chi" points to v1, fails to find some public functions from v3 and dies.

As semantic import versioning seems to be the official way, we should respect it.

This is an experimental way of implementing go-chi#302 without major version bump.
Backwards compatibility is done via `v3` symlink - old go is OK with it.
  • Loading branch information
mwf committed Jun 19, 2018
1 parent cca4135 commit 9c3beff
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 9 deletions.
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-20180611182652-db08ff08e862
golang.org/x/text v0.3.0
)
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
1 change: 1 addition & 0 deletions v3

0 comments on commit 9c3beff

Please sign in to comment.