From 96277473f53e165aaa3c546a5b5acafb38fac1bb Mon Sep 17 00:00:00 2001 From: nissy Date: Tue, 3 Apr 2018 15:46:17 +0900 Subject: [PATCH] bugfix group --- group.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/group.go b/group.go index e330508..e77129b 100644 --- a/group.go +++ b/group.go @@ -9,9 +9,11 @@ type Group struct { } func (g *Group) Group(pattern string, middlewares ...Middleware) *Group { - g.prefix += compensatePattern(pattern) - g.middlewares = append(g.middlewares, middlewares...) - return g + return &Group{ + mux: g.mux, + middlewares: append(g.middlewares, middlewares...), + prefix: g.prefix + compensatePattern(pattern), + } } func (g *Group) Use(middlewares ...Middleware) {