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

@@ -11,8 +11,8 @@ package template
import (
"archive/zip"
"bytes"
"os"
"strings"
"testing"
"github.com/gohugoio/hugo/tpl/internal/go_templates/texttemplate/parse"
@@ -249,7 +249,7 @@ func TestEmptyTemplate(t *testing.T) {
t.Fatal(err)
}
}
buf := &bytes.Buffer{}
buf := &strings.Builder{}
if err := m.Execute(buf, c.in); err != nil {
t.Error(i, err)
continue
@@ -284,7 +284,7 @@ func TestIssue19294(t *testing.T) {
t.Fatal(err)
}
}
var buf bytes.Buffer
var buf strings.Builder
res.Execute(&buf, 0)
if buf.String() != "stylesheet" {
t.Fatalf("iteration %d: got %q; expected %q", i, buf.String(), "stylesheet")