diff --git a/.travis.yml b/.travis.yml index b53c7f8e..0da095b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,12 @@ go: - 1.11.x script: - - GO111MODULE=on go test ./... + - export GO111MODULE=on + - go test ./... + - for i in _examples/*/; do go build $i/*.go || exit 1; done - > go_version=$(go version); if [ ${go_version:13:4} = "1.11" ]; then go get -u golang.org/x/tools/cmd/goimports; goimports -d -e ./ | grep '.*' && { echo; echo "Aborting due to non-empty goimports output."; exit 1; } || :; fi - - cd _examples && for i in */; do GO111MODULE=on go build $i/*.go; done diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ae86f7b..698b74f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ - chi v4 requires Go 1.10.3+ (or Go 1.9.7+) - chi v4 is a Go module and thus breaks the import path; use `github.com/go-chi/chi/v4` and `github.com/go-chi/chi/v4/middleware` +### Upgrading your codebase from chi v3.x to chi v4 + +Example using GNU find (`brew install find`): +``` +$ find . -type f -name '*.go' -not -path "./vendor/*" -exec sed -i 's+github.com/go-chi/chi+github.com/go-chi/chi/v4+g' {} \; +``` + +We recommend vendoring the dependencies via `GO111MODULE=on go mod vendor && GO111MODULE=on go mod tidy`. + +If your repository still pulls in the old import path, you can figure out why by running `GO111MODULE=on go mod why github.com/go-chi/chi`. ## v3.3.4 (2019-01-07) diff --git a/_examples/go.mod b/_examples/go.mod deleted file mode 100644 index e154c91f..00000000 --- a/_examples/go.mod +++ /dev/null @@ -1 +0,0 @@ -module github.com/go-chi/chi/v4/_examples diff --git a/chi.go b/chi.go index 192df6a8..4363adad 100644 --- a/chi.go +++ b/chi.go @@ -1,7 +1,7 @@ // // Package chi is a small, idiomatic and composable router for building HTTP services. // -// chi requires Go 1.7 or newer. +// chi v4 requires Go 1.10.3+ (or Go 1.9.7+). // // Example: // package main @@ -25,7 +25,7 @@ // http.ListenAndServe(":3333", r) // } // -// See github.com/go-chi/chi/v4/_examples/ for more in-depth examples. +// See https://github.com/go-chi/chi/tree/master/_examples for more in-depth examples. // // URL patterns allow for easy matching of path components in HTTP // requests. The matching components can then be accessed using