Last Updated: May 22, 2026
Before Go 1.22, the standard library's http.ServeMux could only match URL paths, not HTTP methods, and it had no concept of path parameters like {id}. Most teams used a third-party router (gorilla/mux, chi, httprouter) to get those features. Go 1.22 fixed that gap. The built-in ServeMux now understands method-prefixed patterns, named wildcards, and trailing-slash wildcards, which is enough to build a real REST API without a router dependency.