mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
tpl: Sync go_templates for Go 1.18
Using Go tag go1.18 4aa1efed4853ea067d665a952eee77c52faac774 Updates #9677
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build go1.13 && !windows
|
||||
// +build go1.13,!windows
|
||||
|
||||
package template
|
||||
@@ -15,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
func TestTypedContent(t *testing.T) {
|
||||
data := []interface{}{
|
||||
data := []any{
|
||||
`<b> "foo%" O'Reilly &bar;`,
|
||||
htmltemplate.CSS(`a[href =~ "//example.com"]#foo`),
|
||||
htmltemplate.HTML(`Hello, <b>World</b> &tc!`),
|
||||
@@ -452,7 +453,7 @@ func TestEscapingNilNonemptyInterfaces(t *testing.T) {
|
||||
|
||||
// A non-empty interface should print like an empty interface.
|
||||
want := new(bytes.Buffer)
|
||||
data := struct{ E interface{} }{}
|
||||
data := struct{ E any }{}
|
||||
tmpl.Execute(want, data)
|
||||
|
||||
if !bytes.Equal(want.Bytes(), got.Bytes()) {
|
||||
|
Reference in New Issue
Block a user