Skip to content

Commit

Permalink
Bump to go 1.21 in go.mod
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Aug 1, 2024
1 parent 071f8b4 commit 9257301
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,4 @@ require (

toolchain go1.21.0

go 1.20
go 1.21
4 changes: 2 additions & 2 deletions tpl/internal/go_templates/htmltemplate/clone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions tpl/internal/go_templates/htmltemplate/content_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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())
}
Expand Down
4 changes: 2 additions & 2 deletions tpl/internal/go_templates/htmltemplate/css_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 2 additions & 4 deletions tpl/internal/go_templates/htmltemplate/escape_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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)

}
}
}
Expand Down
5 changes: 0 additions & 5 deletions tpl/internal/go_templates/htmltemplate/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -83,7 +80,6 @@ func Example() {
// <div><strong>no rows</strong></div>
// </body>
// </html>

}

func Example_autoescaping() {
Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions tpl/internal/go_templates/htmltemplate/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tpl/internal/go_templates/htmltemplate/html_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions tpl/internal/go_templates/htmltemplate/js_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tpl/internal/go_templates/htmltemplate/multi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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}}`,
}
Expand Down
4 changes: 0 additions & 4 deletions tpl/internal/go_templates/htmltemplate/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -18,7 +15,6 @@ import (
)

func TestTemplateClone(t *testing.T) {

orig := New("name")
clone, err := orig.Clone()
if err != nil {
Expand Down
5 changes: 2 additions & 3 deletions tpl/internal/go_templates/htmltemplate/transition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"}
Expand Down
4 changes: 2 additions & 2 deletions tpl/internal/go_templates/htmltemplate/url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
39 changes: 25 additions & 14 deletions tpl/internal/go_templates/texttemplate/multi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
// 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

// Tests for multiple-template parsing and execution.

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 (
Expand All @@ -31,22 +32,32 @@ type multiParseTest struct {
}

var multiParseTests = []multiParseTest{
{"empty", "", noError,
{
"empty", "", noError,
nil,
nil,
nil},
{"one", `{{define "foo"}} FOO {{end}}`, noError,
},
{
"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) {
Expand Down Expand Up @@ -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}}`,
}
Expand Down

0 comments on commit 9257301

Please sign in to comment.