From 4e240688b5ab9e5d94420f5906af3e0a085c07df Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Thu, 19 Sep 2024 18:56:36 +0800 Subject: [PATCH] use uritemplate.MustNew --- content/docs/masque/client.md | 3 +-- content/docs/masque/proxy.md | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/content/docs/masque/client.md b/content/docs/masque/client.md index 1bbadf6..1b46553 100644 --- a/content/docs/masque/client.md +++ b/content/docs/masque/client.md @@ -9,8 +9,7 @@ weight: 2 A client needs to be configured with the same URI template as the proxy. For more information on URI templates, see the [URI Templates]({{< relref "proxy#uri-templates" >}}) section on the proxy page. ```go -t, err := uritemplate.New("https://example.org:4443/masque?h={target_host}&p={target_port}") -// ... handle error ... +t := uritemplate.MustNew("https://example.org:4443/masque?h={target_host}&p={target_port}") cl := masque.Client{ Template: t, } diff --git a/content/docs/masque/proxy.md b/content/docs/masque/proxy.md index 6d89bfc..3af1740 100644 --- a/content/docs/masque/proxy.md +++ b/content/docs/masque/proxy.md @@ -28,7 +28,7 @@ When receiving a request at the specified HTTP handler, the server decodes the U To run a CONNECT-UDP proxy on `https://example.org:4443` with the URI template `https://example.org:4443/masque?h={target_host}&p={target_port}`: ```go -t, err := uritemplate.New("https://example.org:4443/masque?h={target_host}&p={target_port}") +t := uritemplate.MustNew("https://example.org:4443/masque?h={target_host}&p={target_port}") // ... error handling var proxy masque.Proxy http.Handle("/masque", func(w http.ResponseWriter, r *http.Request) {