cannot use session.Middleware
While I following official session example, it throws this error:
cannot use session.Middleware(sessions.NewCookieStore(([]byte)("secret"))) (type "github.com/labstack/echo/v4".MiddlewareFunc) as type "github.com/labstack/echo".MiddlewareFunc in argument to e.Use
here is the go.mod:
module github.com/pyprism/Proj
go 1.12
require (
github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect
github.com/gorilla/sessions v1.2.0
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 // indirect
github.com/jinzhu/gorm v1.9.10
github.com/labstack/echo v3.3.10+incompatible
github.com/labstack/echo-contrib v0.6.0
github.com/labstack/echo/v4 v4.1.11 // indirect
github.com/lestrrat-go/file-rotatelogs v2.2.0+incompatible
github.com/lestrrat-go/strftime v0.0.0-20190725011945-5c849dd2c51d // indirect
github.com/sirupsen/logrus v1.2.0
github.com/spf13/viper v1.4.0
github.com/tebeka/strftime v0.1.3 // indirect
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4
)
@pyprism You need to use the following imports:
"github.com/labstack/echo/v4"
"github.com/labstack/echo-contrib/session"
"github.com/labstack/echo/v4/middleware"
@vishr maybe we should update the docs at https://echo.labstack.com/middleware/session
I can take this up if help is needed
@hsluoyz Help is always welcomed! 👍
+1 still exists, cant use any of the middleware
closing, old, wrong import used