fix issue in empty router group error of ghttp.Server

This commit is contained in:
John
2019-04-12 00:19:15 +08:00
parent c3e716dafd
commit 8a32a8271c

View File

@ -26,13 +26,13 @@ type GroupItem = []interface{}
// 获取分组路由对象
func (s *Server) Group(prefix...string) *RouterGroup {
group := &RouterGroup{
server : s,
}
if len(prefix) > 0 {
return &RouterGroup{
server : s,
prefix : prefix[0],
}
group.prefix = prefix[0]
}
return &RouterGroup{}
return group
}
// 获取分组路由对象