From e24dc1b377e01247c60a28e3dda39bc5c22295ba Mon Sep 17 00:00:00 2001 From: Levente Nas Date: Fri, 8 Nov 2024 20:34:32 +0100 Subject: [PATCH] fix: call routegroup's register route directly in handle subpath --- unstable/simplerouter/router.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unstable/simplerouter/router.go b/unstable/simplerouter/router.go index 76eb866..10f25ac 100644 --- a/unstable/simplerouter/router.go +++ b/unstable/simplerouter/router.go @@ -136,8 +136,8 @@ func (rg *RouteGroup) Handle(method string, path string, handler http.Handler) { rg.HandleFunc(method, path, handler.ServeHTTP) } -func (rg *RouteGroup) HandleSubpath(path string, handler http.Handler) { - rg.mux.Handle(path, handler) +func (rg *RouteGroup) SubpathHandle(path string, handler http.Handler) { + rg.registerRoute("", path, handler.ServeHTTP) } func (rg *RouteGroup) GET(path string, handler http.Handler) {