1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14:31 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Hasty Granbery 2015-09-02 23:08:37 -07:00 committed by Vishal Rana
parent 926cc42506
commit 87fd53d230

View File

@ -414,7 +414,11 @@ func serveFile(dir, file string, c *Context) error {
func (e *Echo) Group(prefix string, m ...Middleware) *Group {
g := &Group{*e}
g.echo.prefix += prefix
if len(m) > 0 {
if len(m) == 0 {
mw := make([]MiddlewareFunc, len(g.echo.middleware))
copy(mw, g.echo.middleware)
g.echo.middleware = mw
} else {
g.echo.middleware = nil
g.Use(m...)
}