_content/blog: fix function name in routing post
Fixes golang/go#66199.
Change-Id: I8a502d3e97631809409b757abcac412ba9213833
Reviewed-on: https://go-review.googlesource.com/c/website/+/571275
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
diff --git a/_content/blog/routing-enhancements.md b/_content/blog/routing-enhancements.md
index d27d307..8e3f5e1 100644
--- a/_content/blog/routing-enhancements.md
+++ b/_content/blog/routing-enhancements.md
@@ -35,7 +35,7 @@
ID 234. Before Go 1.22, the code for handling those requests would start with a
line like this:
- http.Handle("/posts/", handlePost)
+ http.HandleFunc("/posts/", handlePost)
The trailing slash routes all requests beginning `/posts/` to the `handlePost`
function, which would have to check that the HTTP method was GET, extract
@@ -46,7 +46,7 @@
In Go 1.22, the existing code will continue to work, or you could instead write this:
- http.Handle("GET /posts/{id}", handlePost2)
+ http.HandleFunc("GET /posts/{id}", handlePost2)
This pattern matches a GET request whose path begins "/posts/" and has two
segments. (As a special case, GET also matches HEAD; all the other methods match