all repos — gomponents @ 8b43a908820fb8c6b8a0f6d68d11bb2596a9e033

HTML components in pure Go

Add links to godoc (#183) Also add an example for `http.Adapt`. Fixes #182

Markus Wüstenberg
commit

8b43a908820fb8c6b8a0f6d68d11bb2596a9e033

parent

a79e6d9d10099c418846280ae4a4997e82f6efee

1 file changed, 8 insertions(+), 0 deletions(-)

changed files
M http/handler_test.gohttp/handler_test.go
@@ -112,3 +112,11 @@ t.Fatal(err)
} 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) +}