From 42b8a22351e9760a6774e14fe5f24d16aafe1138 Mon Sep 17 00:00:00 2001 From: Christopher Hunter <8398225+crhntr@users.noreply.github.com> Date: Wed, 27 Nov 2024 22:50:26 -0800 Subject: [PATCH] docs: fix id in path --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3575e2a..19f41da 100644 --- a/README.md +++ b/README.md @@ -127,11 +127,11 @@ type RoutesReceiver interface { } func routes(mux *http.ServeMux, receiver RoutesReceiver) { - mux.HandleFunc("GET /articles/:id", func(response http.ResponseWriter, request *http.Request) { + mux.HandleFunc("GET /articles/{id}", func(response http.ResponseWriter, request *http.Request) { ctx := request.Context() id := request.PathValue("id") data := receiver.ReadArticle(ctx, id) - execute(response, request, true, "GET /articles/:id ReadArticle(ctx, id)", http.StatusOK, data) + execute(response, request, true, "GET /articles/{id} ReadArticle(ctx, id)", http.StatusOK, data) }) }