apply modernisation code fixes
1 file changed, 3 insertions(+), 3 deletions(-)
changed files
M gomponents.go → gomponents.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 }) }