ensureRouter lazily initializes the router on first use, so all Set* configuration is applied before the middleware chain is built.
()
| 1722 | // ensureRouter lazily initializes the router on first use, so all Set* |
| 1723 | // configuration is applied before the middleware chain is built. |
| 1724 | func (s *Server) ensureRouter() { |
| 1725 | s.routerOnce.Do(func() { |
| 1726 | s.setupRouter() |
| 1727 | }) |
| 1728 | } |
| 1729 | |
| 1730 | func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
| 1731 | s.ensureRouter() |
no test coverage detected