all repos — gomponents @ b9d3c0f0ff17145c373c7bed0f923037f85c40a6

HTML components in pure Go

apply modernisation code fixes

Alan Pearce
commit

b9d3c0f0ff17145c373c7bed0f923037f85c40a6

parent

b5675a9e960661545c38053e8a50a3f20d100a81

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

changed files
M gomponents.gogomponents.go
@@ -226,7 +226,7 @@ })
} // Textf creates a text DOM [Node] that Renders the interpolated and escaped string format. -func Textf(format string, a ...interface{}) Node { +func Textf(format string, a ...any) Node { return NodeFunc(func(w io.Writer) error { _, err := w.Write([]byte(template.HTMLEscapeString(fmt.Sprintf(format, a...)))) return err
@@ -242,9 +242,9 @@ })
} // Rawf creates a text DOM [Node] that just Renders the interpolated and unescaped string format. -func Rawf(format string, a ...interface{}) Node { +func Rawf(format string, a ...any) Node { return NodeFunc(func(w io.Writer) error { - _, err := w.Write([]byte(fmt.Sprintf(format, a...))) + _, err := w.Write(fmt.Appendf(nil, format, a...)) return err }) }