diff --git a/README.md b/README.md index 49e4d3b10..1db5e3563 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,26 @@ [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/labstack/echo) [![Go Report Card](https://goreportcard.com/badge/github.com/labstack/echo?style=flat-square)](https://goreportcard.com/report/github.com/labstack/echo) [![Build Status](http://img.shields.io/travis/labstack/echo.svg?style=flat-square)](https://travis-ci.org/labstack/echo) -[![Codecov](https://img.shields.io/codecov/c/github/labstack/echo.svg?style=flat-square)](https://codecov.io/gh/labstack/echo) +[![Codecov](https://img.shields.io/codecov/c/github/labstack/echo.svg?style=flat-square)](https://codecov.io/gh/labstack/echo) [![Join the chat at https://gitter.im/labstack/echo](https://img.shields.io/badge/gitter-join%20chat-brightgreen.svg?style=flat-square)](https://gitter.im/labstack/echo) [![Forum](https://img.shields.io/badge/community-forum-00afd1.svg?style=flat-square)](https://forum.labstack.com) [![Twitter](https://img.shields.io/badge/twitter-@labstack-55acee.svg?style=flat-square)](https://twitter.com/labstack) [![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/labstack/echo/master/LICENSE) +## Supported Go versions + +As of version 4.0.0, Echo is available as a [Go module](https://github.com/golang/go/wiki/Modules). +Therefore a Go version capable of understanding /vN suffixed imports is required: + +- 1.9.7+ +- 1.10.3+ +- 1.11+ + +Any of these versions will allow you to import Echo as `github.com/labstack/echo/v4` which is the recommended +way of using Echo going forward. + +For older versions, please use the latest v3 tag. + ## Feature Overview - Optimized HTTP router which smartly prioritize routes @@ -44,8 +58,8 @@ package main import ( "net/http" - "github.com/labstack/echo" - "github.com/labstack/echo/middleware" + "github.com/labstack/echo/v4" + "github.com/labstack/echo/v4/middleware" ) func main() { @@ -90,6 +104,7 @@ func hello(c echo.Context) error { - Improve/fix documentation ## Credits + - [Vishal Rana](https://github.com/vishr) - Author - [Nitin Rana](https://github.com/nr17) - Consultant - [Contributors](https://github.com/labstack/echo/graphs/contributors) diff --git a/echo.go b/echo.go index 9dedea97a..0fe6880fa 100644 --- a/echo.go +++ b/echo.go @@ -8,8 +8,8 @@ Example: import ( "net/http" - "github.com/labstack/echo" - "github.com/labstack/echo/middleware" + "github.com/labstack/echo/v4" + "github.com/labstack/echo/v4/middleware" ) // Handler @@ -221,7 +221,7 @@ const ( const ( // Version of Echo - Version = "3.3.11-dev" + Version = "4.0.0" website = "https://echo.labstack.com" // http://patorjk.com/software/taag/#p=display&f=Small%20Slant&t=Echo banner = ` diff --git a/go.mod b/go.mod new file mode 100644 index 000000000..2853cba54 --- /dev/null +++ b/go.mod @@ -0,0 +1,13 @@ +module github.com/labstack/echo/v4 + +require ( + github.com/dgrijalva/jwt-go v3.2.0+incompatible + github.com/labstack/gommon v0.2.8 + github.com/mattn/go-colorable v0.0.9 // indirect + github.com/mattn/go-isatty v0.0.4 // indirect + github.com/stretchr/testify v1.3.0 + github.com/valyala/bytebufferpool v1.0.0 // indirect + github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4 + golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664 + golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 000000000..e69819312 --- /dev/null +++ b/go.sum @@ -0,0 +1,23 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/labstack/gommon v0.2.8 h1:JvRqmeZcfrHC5u6uVleB4NxxNbzx6gpbJiQknDbKQu0= +github.com/labstack/gommon v0.2.8/go.mod h1:/tj9csK2iPSBvn+3NLM9e52usepMtrd5ilFYA+wQNJ4= +github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4 h1:gKMu1Bf6QINDnvyZuTaACm9ofY+PRh+5vFz4oxBZeF8= +github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4/go.mod h1:50wTf68f99/Zt14pr046Tgt3Lp2vLyFZKzbFXTOabXw= +golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664 h1:YbZJ76lQ1BqNhVe7dKTSB67wDrc2VPRR75IyGyyPDX8= +golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc h1:WiYx1rIFmx8c0mXAFtv5D/mHyKe1+jmuP7PViuwqwuQ= +golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/middleware/basic_auth.go b/middleware/basic_auth.go index e6c963245..76ba24206 100644 --- a/middleware/basic_auth.go +++ b/middleware/basic_auth.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) type ( diff --git a/middleware/basic_auth_test.go b/middleware/basic_auth_test.go index 54a608b65..76039db0a 100644 --- a/middleware/basic_auth_test.go +++ b/middleware/basic_auth_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) diff --git a/middleware/body_dump.go b/middleware/body_dump.go index e64e5e112..418d279d9 100644 --- a/middleware/body_dump.go +++ b/middleware/body_dump.go @@ -8,7 +8,7 @@ import ( "net" "net/http" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) type ( @@ -105,7 +105,3 @@ func (w *bodyDumpResponseWriter) Flush() { func (w *bodyDumpResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { return w.ResponseWriter.(http.Hijacker).Hijack() } - -func (w *bodyDumpResponseWriter) CloseNotify() <-chan bool { - return w.ResponseWriter.(http.CloseNotifier).CloseNotify() -} diff --git a/middleware/body_dump_test.go b/middleware/body_dump_test.go index daccd4d5c..e6e00f726 100644 --- a/middleware/body_dump_test.go +++ b/middleware/body_dump_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) diff --git a/middleware/body_limit.go b/middleware/body_limit.go index c83f57e1f..b436bd595 100644 --- a/middleware/body_limit.go +++ b/middleware/body_limit.go @@ -5,7 +5,7 @@ import ( "io" "sync" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/labstack/gommon/bytes" ) diff --git a/middleware/body_limit_test.go b/middleware/body_limit_test.go index 5659fa357..0e8642a06 100644 --- a/middleware/body_limit_test.go +++ b/middleware/body_limit_test.go @@ -7,7 +7,7 @@ import ( "net/http/httptest" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) diff --git a/middleware/compress.go b/middleware/compress.go index b876009cb..190520645 100644 --- a/middleware/compress.go +++ b/middleware/compress.go @@ -9,7 +9,7 @@ import ( "net/http" "strings" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) type ( @@ -116,7 +116,3 @@ func (w *gzipResponseWriter) Flush() { func (w *gzipResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { return w.ResponseWriter.(http.Hijacker).Hijack() } - -func (w *gzipResponseWriter) CloseNotify() <-chan bool { - return w.ResponseWriter.(http.CloseNotifier).CloseNotify() -} diff --git a/middleware/compress_test.go b/middleware/compress_test.go index a4c928a2f..dc7d78cc9 100644 --- a/middleware/compress_test.go +++ b/middleware/compress_test.go @@ -8,7 +8,7 @@ import ( "net/http/httptest" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) diff --git a/middleware/cors.go b/middleware/cors.go index d8b633ff4..c61c7125c 100644 --- a/middleware/cors.go +++ b/middleware/cors.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) type ( diff --git a/middleware/cors_test.go b/middleware/cors_test.go index 95ef9b816..7a71e733d 100644 --- a/middleware/cors_test.go +++ b/middleware/cors_test.go @@ -5,7 +5,7 @@ import ( "net/http/httptest" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) diff --git a/middleware/csrf.go b/middleware/csrf.go index 477872ea4..09a66bb64 100644 --- a/middleware/csrf.go +++ b/middleware/csrf.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/labstack/gommon/random" ) diff --git a/middleware/csrf_test.go b/middleware/csrf_test.go index 422ed5d7c..efb4dd1d2 100644 --- a/middleware/csrf_test.go +++ b/middleware/csrf_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/labstack/gommon/random" "github.com/stretchr/testify/assert" ) diff --git a/middleware/jwt.go b/middleware/jwt.go index 051c589cd..861d3142e 100644 --- a/middleware/jwt.go +++ b/middleware/jwt.go @@ -7,7 +7,7 @@ import ( "strings" "github.com/dgrijalva/jwt-go" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) type ( diff --git a/middleware/jwt_test.go b/middleware/jwt_test.go index fee6daaa3..fc90073af 100644 --- a/middleware/jwt_test.go +++ b/middleware/jwt_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/dgrijalva/jwt-go" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) diff --git a/middleware/key_auth.go b/middleware/key_auth.go index c12f4ca9d..fe01e23e0 100644 --- a/middleware/key_auth.go +++ b/middleware/key_auth.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) type ( diff --git a/middleware/key_auth_test.go b/middleware/key_auth_test.go index 3213fc08d..b874898c8 100644 --- a/middleware/key_auth_test.go +++ b/middleware/key_auth_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) diff --git a/middleware/logger.go b/middleware/logger.go index dab3ef7bf..b2e48347b 100644 --- a/middleware/logger.go +++ b/middleware/logger.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/labstack/gommon/color" "github.com/valyala/fasttemplate" ) diff --git a/middleware/logger_test.go b/middleware/logger_test.go index 98130b108..76b205aa8 100644 --- a/middleware/logger_test.go +++ b/middleware/logger_test.go @@ -12,7 +12,7 @@ import ( "time" "unsafe" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) diff --git a/middleware/method_override.go b/middleware/method_override.go index 0a6103bb5..92b14d2ed 100644 --- a/middleware/method_override.go +++ b/middleware/method_override.go @@ -3,7 +3,7 @@ package middleware import ( "net/http" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) type ( diff --git a/middleware/method_override_test.go b/middleware/method_override_test.go index 4d446552f..5760b1581 100644 --- a/middleware/method_override_test.go +++ b/middleware/method_override_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) diff --git a/middleware/middleware.go b/middleware/middleware.go index febbdae95..d0b7153cb 100644 --- a/middleware/middleware.go +++ b/middleware/middleware.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) type ( diff --git a/middleware/proxy.go b/middleware/proxy.go index 1789c756a..9d67f4450 100644 --- a/middleware/proxy.go +++ b/middleware/proxy.go @@ -13,7 +13,7 @@ import ( "sync/atomic" "time" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) // TODO: Handle TLS proxy @@ -37,11 +37,11 @@ type ( // "/users/*/orders/*": "/user/$1/order/$2", Rewrite map[string]string - // Context key to store selected ProxyTarget into context. + // Context key to store selected ProxyTarget into context. // Optional. Default value "target". ContextKey string - // To customize the transport to remote. + // To customize the transport to remote. // Examples: If custom TLS certificates are required. Transport http.RoundTripper diff --git a/middleware/proxy_1_11.go b/middleware/proxy_1_11.go index 193015af1..7784f9c69 100644 --- a/middleware/proxy_1_11.go +++ b/middleware/proxy_1_11.go @@ -7,7 +7,7 @@ import ( "net/http" "net/http/httputil" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) func proxyHTTP(tgt *ProxyTarget, c echo.Context, config ProxyConfig) http.Handler { diff --git a/middleware/proxy_1_11_n.go b/middleware/proxy_1_11_n.go index d4620e26c..9a78929fe 100644 --- a/middleware/proxy_1_11_n.go +++ b/middleware/proxy_1_11_n.go @@ -3,9 +3,10 @@ package middleware import ( - "github.com/labstack/echo" "net/http" "net/http/httputil" + + "github.com/labstack/echo/v4" ) func proxyHTTP(t *ProxyTarget, c echo.Context, config ProxyConfig) http.Handler { diff --git a/middleware/proxy_1_11_test.go b/middleware/proxy_1_11_test.go index 25798e9f1..f132f5214 100644 --- a/middleware/proxy_1_11_test.go +++ b/middleware/proxy_1_11_test.go @@ -8,7 +8,7 @@ import ( "net/url" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) @@ -42,10 +42,10 @@ func TestProxy_1_11(t *testing.T) { e := echo.New() e.Use(Proxy(rb)) req := httptest.NewRequest(http.MethodGet, "/", nil) - rec := newCloseNotifyRecorder() + rec := httptest.NewRecorder() // Remote unreachable - rec = newCloseNotifyRecorder() + rec = httptest.NewRecorder() req.URL.Path = "/api/users" e.ServeHTTP(rec, req) assert.Equal(t, "/api/users", req.URL.Path) diff --git a/middleware/proxy_test.go b/middleware/proxy_test.go index 8614088ea..1a375db86 100644 --- a/middleware/proxy_test.go +++ b/middleware/proxy_test.go @@ -7,32 +7,10 @@ import ( "net/url" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) -type ( - closeNotifyRecorder struct { - *httptest.ResponseRecorder - closed chan bool - } -) - -func newCloseNotifyRecorder() *closeNotifyRecorder { - return &closeNotifyRecorder{ - httptest.NewRecorder(), - make(chan bool, 1), - } -} - -func (c *closeNotifyRecorder) close() { - c.closed <- true -} - -func (c *closeNotifyRecorder) CloseNotify() <-chan bool { - return c.closed -} - func TestProxy(t *testing.T) { // Setup t1 := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -71,7 +49,7 @@ func TestProxy(t *testing.T) { e := echo.New() e.Use(Proxy(rb)) req := httptest.NewRequest(http.MethodGet, "/", nil) - rec := newCloseNotifyRecorder() + rec := httptest.NewRecorder() e.ServeHTTP(rec, req) body := rec.Body.String() expected := map[string]bool{ @@ -92,11 +70,11 @@ func TestProxy(t *testing.T) { rrb := NewRoundRobinBalancer(targets) e = echo.New() e.Use(Proxy(rrb)) - rec = newCloseNotifyRecorder() + rec = httptest.NewRecorder() e.ServeHTTP(rec, req) body = rec.Body.String() assert.Equal(t, "target 1", body) - rec = newCloseNotifyRecorder() + rec = httptest.NewRecorder() e.ServeHTTP(rec, req) body = rec.Body.String() assert.Equal(t, "target 2", body) @@ -138,6 +116,6 @@ func TestProxy(t *testing.T) { e = echo.New() e.Use(contextObserver) e.Use(Proxy(rrb1)) - rec = newCloseNotifyRecorder() + rec = httptest.NewRecorder() e.ServeHTTP(rec, req) } diff --git a/middleware/recover.go b/middleware/recover.go index 2a42c5b18..e87aaf321 100644 --- a/middleware/recover.go +++ b/middleware/recover.go @@ -4,7 +4,7 @@ import ( "fmt" "runtime" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) type ( diff --git a/middleware/recover_test.go b/middleware/recover_test.go index 053c34fcd..37707c5c1 100644 --- a/middleware/recover_test.go +++ b/middleware/recover_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) diff --git a/middleware/redirect.go b/middleware/redirect.go index 422263dec..30a2e403b 100644 --- a/middleware/redirect.go +++ b/middleware/redirect.go @@ -3,7 +3,7 @@ package middleware import ( "net/http" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) // RedirectConfig defines the config for Redirect middleware. diff --git a/middleware/redirect_test.go b/middleware/redirect_test.go index 811c4307a..082609574 100644 --- a/middleware/redirect_test.go +++ b/middleware/redirect_test.go @@ -5,7 +5,7 @@ import ( "net/http/httptest" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) diff --git a/middleware/request_id.go b/middleware/request_id.go index f376c296d..21f801f3b 100644 --- a/middleware/request_id.go +++ b/middleware/request_id.go @@ -1,7 +1,7 @@ package middleware import ( - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/labstack/gommon/random" ) diff --git a/middleware/request_id_test.go b/middleware/request_id_test.go index c2b526ce6..30eecdef9 100644 --- a/middleware/request_id_test.go +++ b/middleware/request_id_test.go @@ -5,7 +5,7 @@ import ( "net/http/httptest" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) diff --git a/middleware/rewrite.go b/middleware/rewrite.go index 1b322126d..a64e10bb3 100644 --- a/middleware/rewrite.go +++ b/middleware/rewrite.go @@ -4,7 +4,7 @@ import ( "regexp" "strings" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) type ( diff --git a/middleware/rewrite_test.go b/middleware/rewrite_test.go index c73c48657..eb5a46d89 100644 --- a/middleware/rewrite_test.go +++ b/middleware/rewrite_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) diff --git a/middleware/secure.go b/middleware/secure.go index 188c0c406..8839c879c 100644 --- a/middleware/secure.go +++ b/middleware/secure.go @@ -3,7 +3,7 @@ package middleware import ( "fmt" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) type ( diff --git a/middleware/secure_test.go b/middleware/secure_test.go index f53889200..d1cbf187a 100644 --- a/middleware/secure_test.go +++ b/middleware/secure_test.go @@ -5,7 +5,7 @@ import ( "net/http/httptest" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) diff --git a/middleware/slash.go b/middleware/slash.go index 9af56cafe..61d6e30b3 100644 --- a/middleware/slash.go +++ b/middleware/slash.go @@ -1,7 +1,7 @@ package middleware import ( - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) type ( diff --git a/middleware/slash_test.go b/middleware/slash_test.go index a19ffc148..e60be740d 100644 --- a/middleware/slash_test.go +++ b/middleware/slash_test.go @@ -5,7 +5,7 @@ import ( "net/http/httptest" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) diff --git a/middleware/static.go b/middleware/static.go index 55485f34d..bc2087a77 100644 --- a/middleware/static.go +++ b/middleware/static.go @@ -10,7 +10,7 @@ import ( "path/filepath" "strings" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/labstack/gommon/bytes" ) @@ -76,7 +76,7 @@ const html = ` transition: opacity 0.25s; } li span { - color: #707070; + color: #707070; font-size: 12px; } li a:hover { diff --git a/middleware/static_test.go b/middleware/static_test.go index b62406e89..0d695d3db 100644 --- a/middleware/static_test.go +++ b/middleware/static_test.go @@ -5,7 +5,7 @@ import ( "net/http/httptest" "testing" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) diff --git a/response.go b/response.go index 6244783b0..eb2d988df 100644 --- a/response.go +++ b/response.go @@ -91,15 +91,6 @@ func (r *Response) Hijack() (net.Conn, *bufio.ReadWriter, error) { return r.Writer.(http.Hijacker).Hijack() } -// CloseNotify implements the http.CloseNotifier interface to allow detecting -// when the underlying connection has gone away. -// This mechanism can be used to cancel long operations on the server if the -// client has disconnected before the response is ready. -// See [http.CloseNotifier](https://golang.org/pkg/net/http/#CloseNotifier) -func (r *Response) CloseNotify() <-chan bool { - return r.Writer.(http.CloseNotifier).CloseNotify() -} - func (r *Response) reset(w http.ResponseWriter) { r.beforeFuncs = nil r.afterFuncs = nil