From 0e9906769af897c9fe5bf1979f4be3c658d7fc79 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Thu, 14 Sep 2023 16:45:32 +0300 Subject: [PATCH] fix: empty group path --- group.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/group.go b/group.go index 2f82d00..5cd1ce5 100644 --- a/group.go +++ b/group.go @@ -14,9 +14,14 @@ type Group struct { // NewGroup adds a sub-group to this group. func (g *Group) NewGroup(path string, opts ...GroupOption) *Group { + path = joinPath(g.path, path) + if path == "/" { + path = "" + } + group := &Group{ router: g.router, - path: joinPath(g.path, path), + path: path, stack: g.cloneStack(), }