tpl/internal: Sync go_templates

Closes #10411
This commit is contained in:
Bjørn Erik Pedersen
2022-11-14 19:13:09 +01:00
parent 58a98c7758
commit f6ab9553f4
34 changed files with 739 additions and 514 deletions

View File

@@ -8,7 +8,6 @@
package template
import (
"bytes"
"errors"
"fmt"
"io"
@@ -26,7 +25,7 @@ func TestAddParseTreeHTML(t *testing.T) {
t.Fatal(err)
}
added := Must(root.AddParseTree("b", tree["b"]))
b := new(bytes.Buffer)
b := new(strings.Builder)
err = added.ExecuteTemplate(b, "a", "1>0")
if err != nil {
t.Fatal(err)
@@ -43,7 +42,7 @@ func TestClone(t *testing.T) {
// In the t2 template, it will be in a JavaScript context.
// In the t3 template, it will be in a CSS context.
const tmpl = `{{define "a"}}{{template "lhs"}}{{.}}{{template "rhs"}}{{end}}`
b := new(bytes.Buffer)
b := new(strings.Builder)
// Create an incomplete template t0.
t0 := Must(New("t0").Parse(tmpl))