diff options
Diffstat (limited to 'gomponents.go')
-rw-r--r-- | gomponents.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gomponents.go b/gomponents.go index beaf1dd..d160b54 100644 --- a/gomponents.go +++ b/gomponents.go @@ -10,6 +10,7 @@ package gomponents import ( "fmt" "html/template" + "io" "strings" ) @@ -114,3 +115,9 @@ func Raw(t string) NodeFunc { return t } } + +// Write to the given io.Writer, returning any error. +func Write(w io.Writer, n Node) error { + _, err := w.Write([]byte(n.Render())) + return err +} |