From 8b43a908820fb8c6b8a0f6d68d11bb2596a9e033 Mon Sep 17 00:00:00 2001 From: Markus Wüstenberg Date: Wed, 26 Jun 2024 10:32:46 +0200 Subject: Add links to godoc (#183) Also add an example for `http.Adapt`. Fixes #182--- http/handler_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'http/handler_test.go') diff --git a/http/handler_test.go b/http/handler_test.go index 822d69a..706e9eb 100644 --- a/http/handler_test.go +++ b/http/handler_test.go @@ -112,3 +112,11 @@ func get(t *testing.T, h http.Handler) (int, string) { } return result.StatusCode, string(body) } + +func ExampleAdapt() { + h := ghttp.Adapt(func(w http.ResponseWriter, r *http.Request) (g.Node, error) { + return g.El("div"), nil + }) + mux := http.NewServeMux() + mux.Handle("/", h) +} -- cgit 1.4.1