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

panic: echo => unknown middleware #75

Closed
markbates opened this issue May 20, 2015 · 2 comments
Closed

panic: echo => unknown middleware #75

markbates opened this issue May 20, 2015 · 2 comments

Comments

@markbates
Copy link
Contributor

This morning I pulled down the latest version of echo and when I try to use the new middleware I get the following panic:

panic: echo => unknown middleware

goroutine 1 [running]:
github.com/labstack/echo.wrapMiddleware(0x21e600, 0x364d38, 0x18040d0)
        /Users/markbates/Dropbox/development/gocode/src/github.com/labstack/echo/echo.go:399 +0x35c
github.com/labstack/echo.(*Echo).Use(0xc208054090, 0xc20801f768, 0x1, 0x1)
        /Users/markbates/Dropbox/development/gocode/src/github.com/labstack/echo/echo.go:215 +0xa7
main.main()
        /Users/markbates/Dropbox/Desktop/scraps/scrap.go:10 +0xbf

goroutine 2 [runnable]:
runtime.forcegchelper()
        /usr/local/go/src/runtime/proc.go:90
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 3 [runnable]:
runtime.bgsweep()
        /usr/local/go/src/runtime/mgc0.go:82
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 4 [runnable]:
runtime.runfinq()
        /usr/local/go/src/runtime/malloc.go:712
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1
exit status 2

shell returned 1 

Here is a simple, reproducible (for me at least), bit of code to demonstrate the issue.

package main

import (
    "github.com/labstack/echo"
    "github.com/labstack/echo/middleware"
)

func main() {
    e := echo.New()
    e.Use(middleware.Recover)

    e.Run(":3000")
}
@vishr
Copy link
Member

vishr commented May 20, 2015

There was a recent change to factor in options for the middleware. It should work if you change e.Use(middleware.Recover) to e.Use(middleware.Recover())

@markbates
Copy link
Contributor Author

That worked. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants