mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Bump to go 1.21 in go.mod
This commit is contained in:
parent
071f8b4466
commit
92573012e8
14 changed files with 50 additions and 50 deletions
2
go.mod
2
go.mod
|
@ -163,4 +163,4 @@ require (
|
|||
|
||||
toolchain go1.21.0
|
||||
|
||||
go 1.20
|
||||
go 1.21
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// 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
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package template
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// 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
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package template
|
||||
|
||||
|
@ -428,7 +428,7 @@ func TestStringer(t *testing.T) {
|
|||
if err := tmpl.Execute(b, s); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var expect = "string=3"
|
||||
expect := "string=3"
|
||||
if b.String() != expect {
|
||||
t.Errorf("expected %q got %q", expect, b.String())
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// 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
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package template
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// 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
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package template
|
||||
|
||||
|
@ -944,7 +944,6 @@ func TestEscapeSet(t *testing.T) {
|
|||
t.Errorf("want\n\t%q\ngot\n\t%q", test.want, got)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestErrors(t *testing.T) {
|
||||
|
@ -1194,7 +1193,6 @@ func TestErrors(t *testing.T) {
|
|||
// Check that we get the same error if we call Execute again.
|
||||
if err := tmpl.Execute(buf, nil); err == nil || err.Error() != got {
|
||||
t.Errorf("input=%q: unexpected error on second call %q", test.input, err)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,9 +2,6 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build go1.13
|
||||
// +build go1.13
|
||||
|
||||
package template_test
|
||||
|
||||
import (
|
||||
|
@ -83,7 +80,6 @@ func Example() {
|
|||
// <div><strong>no rows</strong></div>
|
||||
// </body>
|
||||
// </html>
|
||||
|
||||
}
|
||||
|
||||
func Example_autoescaping() {
|
||||
|
@ -124,7 +120,6 @@ func Example_escape() {
|
|||
// \"Fran \u0026 Freddie\'s Diner\" \u003Ctasty@example.com\u003E
|
||||
// \"Fran \u0026 Freddie\'s Diner\"32\u003Ctasty@example.com\u003E
|
||||
// %22Fran+%26+Freddie%27s+Diner%2232%3Ctasty%40example.com%3E
|
||||
|
||||
}
|
||||
|
||||
func ExampleTemplate_Delims() {
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
// Tests for template execution, copied from text/template.
|
||||
|
||||
//go:build go1.13 && !windows
|
||||
// +build go1.13,!windows
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package template
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// 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
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package template
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// 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
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package template
|
||||
|
||||
|
@ -221,7 +221,8 @@ func TestJSStrEscaper(t *testing.T) {
|
|||
{"<!--", `\u003c!--`},
|
||||
{"-->", `--\u003e`},
|
||||
// From https://code.google.com/p/doctype/wiki/ArticleUtf7
|
||||
{"+ADw-script+AD4-alert(1)+ADw-/script+AD4-",
|
||||
{
|
||||
"+ADw-script+AD4-alert(1)+ADw-/script+AD4-",
|
||||
`\u002bADw-script\u002bAD4-alert(1)\u002bADw-\/script\u002bAD4-`,
|
||||
},
|
||||
// Invalid UTF-8 sequence
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
// Tests for multiple-template execution, copied from text/template.
|
||||
|
||||
//go:build go1.13 && !windows
|
||||
// +build go1.13,!windows
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package template
|
||||
|
||||
|
@ -268,7 +268,7 @@ func TestIssue19294(t *testing.T) {
|
|||
// by the contents of "stylesheet", but if the internal map associating
|
||||
// names with templates is built in the wrong order, the empty block
|
||||
// looks non-empty and this doesn't happen.
|
||||
var inlined = map[string]string{
|
||||
inlined := map[string]string{
|
||||
"stylesheet": `{{define "stylesheet"}}stylesheet{{end}}`,
|
||||
"xhtml": `{{block "stylesheet" .}}{{end}}`,
|
||||
}
|
||||
|
|
|
@ -2,9 +2,6 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build go1.13
|
||||
// +build go1.13
|
||||
|
||||
package template_test
|
||||
|
||||
import (
|
||||
|
@ -18,7 +15,6 @@ import (
|
|||
)
|
||||
|
||||
func TestTemplateClone(t *testing.T) {
|
||||
|
||||
orig := New("name")
|
||||
clone, err := orig.Clone()
|
||||
if err != nil {
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// 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
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package template
|
||||
|
||||
|
@ -43,7 +43,6 @@ func TestFindEndTag(t *testing.T) {
|
|||
}
|
||||
|
||||
func BenchmarkTemplateSpecialTags(b *testing.B) {
|
||||
|
||||
r := struct {
|
||||
Name, Gift string
|
||||
}{"Aunt Mildred", "bone china tea set"}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// 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
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package template
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// 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
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package template
|
||||
|
||||
|
@ -11,10 +11,11 @@ package template
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gohugoio/hugo/tpl/internal/go_templates/texttemplate/parse"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/gohugoio/hugo/tpl/internal/go_templates/texttemplate/parse"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -31,22 +32,32 @@ type multiParseTest struct {
|
|||
}
|
||||
|
||||
var multiParseTests = []multiParseTest{
|
||||
{"empty", "", noError,
|
||||
{
|
||||
"empty", "", noError,
|
||||
nil,
|
||||
nil},
|
||||
{"one", `{{define "foo"}} FOO {{end}}`, noError,
|
||||
nil,
|
||||
},
|
||||
{
|
||||
"one", `{{define "foo"}} FOO {{end}}`, noError,
|
||||
[]string{"foo"},
|
||||
[]string{" FOO "}},
|
||||
{"two", `{{define "foo"}} FOO {{end}}{{define "bar"}} BAR {{end}}`, noError,
|
||||
[]string{" FOO "},
|
||||
},
|
||||
{
|
||||
"two", `{{define "foo"}} FOO {{end}}{{define "bar"}} BAR {{end}}`, noError,
|
||||
[]string{"foo", "bar"},
|
||||
[]string{" FOO ", " BAR "}},
|
||||
[]string{" FOO ", " BAR "},
|
||||
},
|
||||
// errors
|
||||
{"missing end", `{{define "foo"}} FOO `, hasError,
|
||||
{
|
||||
"missing end", `{{define "foo"}} FOO `, hasError,
|
||||
nil,
|
||||
nil},
|
||||
{"malformed name", `{{define "foo}} FOO `, hasError,
|
||||
nil,
|
||||
nil},
|
||||
},
|
||||
{
|
||||
"malformed name", `{{define "foo}} FOO `, hasError,
|
||||
nil,
|
||||
nil,
|
||||
},
|
||||
}
|
||||
|
||||
func TestMultiParse(t *testing.T) {
|
||||
|
@ -432,7 +443,7 @@ func TestIssue19294(t *testing.T) {
|
|||
// by the contents of "stylesheet", but if the internal map associating
|
||||
// names with templates is built in the wrong order, the empty block
|
||||
// looks non-empty and this doesn't happen.
|
||||
var inlined = map[string]string{
|
||||
inlined := map[string]string{
|
||||
"stylesheet": `{{define "stylesheet"}}stylesheet{{end}}`,
|
||||
"xhtml": `{{block "stylesheet" .}}{{end}}`,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue