mirror of
https://github.com/hanzoai/base.git
synced 2026-10-21 03:41:50 +00:00
Before: Route() always appended a new *Route[T] to group.children.
Calling GET("/healthz", ...) twice on the same group produced two
children, which caused http.ServeMux.HandleFunc to panic in BuildMux:
panic: pattern "GET /healthz" conflicts with pattern "GET /healthz"
This bit BD on v0.40.1: an init function (BindHealthzRoute) was
invoked twice in the plugin/service composition chain, producing
the panic at app startup with no actionable error.
After: Route() scans group.children for an existing entry with the
same Method+Path. If found, replaces it (last-write-wins) instead of
appending. Routes registered once still work identically.
Test coverage: existing tools/router tests pass (no test for the
duplicate case existed before — added in a follow-up).