Closed
Description
Proposal Details
When testing the muxpatterns implementation which is landing in the stdlib Mux in Go 1.22, I was surprised to find that I could not add extra whitespace between the method and path. For instance, this does not work:
r.Handle("GET /my-route", handler) // note the 2nd space!
Allowing extra spaces is useful when you have many routes and want to keep the code neatly aligned, so it's easy to scan the routes visually. As a small example:
r.Handle("GET /my-route", handler1)
r.Handle("POST /my-route", handler2)
r.Handle("DELETE /my-route", handler3)