From ab836b477e2c0695c4e53aa369c5d95306a925da Mon Sep 17 00:00:00 2001 From: SystemGlitch Date: Fri, 27 Sep 2024 13:25:16 +0200 Subject: [PATCH] Docs: update Server.RegisterRoutes docs --- server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.go b/server.go index 3f5484f4..477655b4 100644 --- a/server.go +++ b/server.go @@ -450,7 +450,9 @@ func (s *Server) Start() error { return nil } -// RegisterRoutes creates a new Router for this Server and runs the given `routeRegistrer`. +// RegisterRoutes runs the given `routeRegistrer` function with this Server and its router. +// The router's regex cache is cleared after the `routeRegistrer` function returns. +// This method should only be called once. func (s *Server) RegisterRoutes(routeRegistrer func(*Server, *Router)) { routeRegistrer(s, s.router) s.router.ClearRegexCache()