]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
Bump to go 1.21 in go.mod
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 1 Aug 2024 08:27:55 +0000 (10:27 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 1 Aug 2024 10:07:27 +0000 (12:07 +0200)
14 files changed:
go.mod
tpl/internal/go_templates/htmltemplate/clone_test.go
tpl/internal/go_templates/htmltemplate/content_test.go
tpl/internal/go_templates/htmltemplate/css_test.go
tpl/internal/go_templates/htmltemplate/escape_test.go
tpl/internal/go_templates/htmltemplate/example_test.go
tpl/internal/go_templates/htmltemplate/exec_test.go
tpl/internal/go_templates/htmltemplate/html_test.go
tpl/internal/go_templates/htmltemplate/js_test.go
tpl/internal/go_templates/htmltemplate/multi_test.go
tpl/internal/go_templates/htmltemplate/template_test.go
tpl/internal/go_templates/htmltemplate/transition_test.go
tpl/internal/go_templates/htmltemplate/url_test.go
tpl/internal/go_templates/texttemplate/multi_test.go

diff --git a/go.mod b/go.mod
index b39a23800c37b2920f555f466d89370db2ee4ae8..dc476abc2634a05344552d6b2a72030fda23ea03 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -163,4 +163,4 @@ require (
 
 toolchain go1.21.0
 
-go 1.20
+go 1.21
index 7db335b5b7dea0fcd0066b8cd9f5c1dd744211ef..e42177a6b32e46274214125c37eeeb26e0d371db 100644 (file)
@@ -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
 
index fac4774cc840ca9b67a1dc5d71e5a654a7903b32..e886ee8ff66500129f9c9651877102caf109f988 100644 (file)
@@ -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())
        }
index f44568930ddfc14857558afcc565050fe41db3f8..f2b2add3a700ff556cdc5f363ee38d5a29b50579 100644 (file)
@@ -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
 
index b202afde0bc1f12e14ae7bf6b80906178ad489f0..66bf50203e2aaae938e1c25d1236b8ecdceced92 100644 (file)
@@ -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)
-
                }
        }
 }
index 6485c7cfbec1cbf4312841b078de677407ba6203..de81132c2514a06ac3cf399ab5255fd0e4e53b20 100644 (file)
@@ -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() {
index e91aeafa15706a194b5c8413537e13ca86d72df6..428cddc0d2837452466c09cacf07da58784dff29 100644 (file)
@@ -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
 
index 2809ee1e2a6321a1130cce223f153a96b185bb85..bea668ef9c9e96eb8c0846810790b0562dc9d3f6 100644 (file)
@@ -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
 
index c78f43b5f7ddd206e0478cca11a1b87fb6bdc980..61a601b028b9f0f86193ac4d36d13eb8c2f7f925 100644 (file)
@@ -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
index f3e629b8864f3474b2ad4e7d8f0bbc802663231f..c320c4353a264a3e2c55717ad87e6f01dd67ef61 100644 (file)
@@ -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}}`,
        }
index 0838308a146e8559aa023a580d96279899250f38..3a0f7463e0a5dd1e031b96b48ada9ae6ba50cd17 100644 (file)
@@ -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 {
index 0bd38800f1a996bc2ec4f1652bbe67ca592af0ea..9eb36558b009655fd117f536e34d1ebbab1b78e4 100644 (file)
@@ -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"}
index 72c8a4fe9be9251261c451aace19d4f382bace31..c7e67c211e494d9e3fb21ea62c8f2d0cd78ace5d 100644 (file)
@@ -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
 
index 6e383c131f8367abb691eb202864615fbff4f92e..6358383e415a3baf2b6bb61a3ff25080aa86acdf 100644 (file)
@@ -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,
-               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) {
@@ -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}}`,
        }