From 29fcec9cb77dcaeb59f33f5c6580f13a65e0ad54 Mon Sep 17 00:00:00 2001 From: Patricio Whittingslow Date: Wed, 29 Jul 2026 16:29:51 -0300 Subject: [PATCH] add PathValue example --- http/httphi/example_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/http/httphi/example_test.go b/http/httphi/example_test.go index 24e92d8..07b6bf8 100644 --- a/http/httphi/example_test.go +++ b/http/httphi/example_test.go @@ -60,6 +60,11 @@ func ExampleMuxSlice_query_forms_multipart() { var mux httphi.MuxSlice + mux.Handle("/users/{id}", func(ex *httphi.Exchange) { + userID := ex.PathValue("id") + fmt.Printf("someone requested data for user %s", userID) + }) + mux.Handle("/query", func(ex *httphi.Exchange) { // query parameter in URL. const decodeQuery = true