all repos — gomponents @ 100ae9e8308f380eeb3c6a5ea7a7e3277483aa43

HTML components in pure Go

Rename Document to Doctype (#54)

Markus Wüstenberg
commit

100ae9e8308f380eeb3c6a5ea7a7e3277483aa43

parent

a76262652b227c95ce140f3698c46f59b79354ac

1 file changed, 3 insertions(+), 3 deletions(-)

changed files
M html/elements.gohtml/elements.go
@@ -14,13 +14,13 @@ func A(href string, children ...g.Node) g.NodeFunc {
return g.El("a", g.Attr("href", href), g.Group(children)) } -// Document returns an special kind of Node that prefixes its child with the string "<!doctype html>". -func Document(child g.Node) g.NodeFunc { +// Doctype returns a special kind of Node that prefixes its sibling with the string "<!doctype html>". +func Doctype(sibling g.Node) g.NodeFunc { return func(w io.Writer) error { if _, err := w.Write([]byte("<!doctype html>")); err != nil { return err } - return child.Render(w) + return sibling.Render(w) } }