From 6c8f0c235287edf7252fe239d4c9beb258c6ff01 Mon Sep 17 00:00:00 2001 From: Markus Wüstenberg Date: Mon, 2 Nov 2020 10:03:05 +0100 Subject: Render to Writer instead of string (#39) The Render function has been changed to take a `Writer` instead of returning a string. This makes it possible to generate documents without having the whole content in memory. This also removes the `gomponents.Write` function, which is now redundant. Furthermore, the `el.Document` function has been changed to only take one child, as multiple children never make sense for it. (It's not even a child, more a sibling.)--- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index b976f42..28f1edf 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ func main() { func handler() http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { page := Page("Hi!", r.URL.Path) - _ = g.Write(w, page) + _ = page.Render(w) } } @@ -91,7 +91,7 @@ func main() { func handler() http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { page := Page("Hi!", r.URL.Path) - _ = g.Write(w, page) + _ = page.Render(w) } } -- cgit 1.4.1