diff --git a/.circleci/config.yml b/.circleci/config.yml
index f7a47a64b..06e643bdd 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -4,7 +4,7 @@ parameters:
defaults: &defaults
resource_class: large
docker:
- - image: bepsays/ci-hugoreleaser:1.22301.20401
+ - image: bepsays/ci-hugoreleaser:1.22400.20000
environment: &buildenv
GOMODCACHE: /root/project/gomodcache
version: 2
@@ -58,7 +58,7 @@ jobs:
environment:
<<: [*buildenv]
docker:
- - image: bepsays/ci-hugoreleaser-linux-arm64:1.22301.20401
+ - image: bepsays/ci-hugoreleaser-linux-arm64:1.22400.20000
steps:
- *restore-cache
- &attach-workspace
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index fb9d71f06..c49c12371 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -16,7 +16,7 @@ jobs:
test:
strategy:
matrix:
- go-version: [1.22.x, 1.23.x]
+ go-version: [1.23.x, 1.24.x]
os: [ubuntu-latest, windows-latest] # macos disabled for now because of disk space issues.
runs-on: ${{ matrix.os }}
steps:
diff --git a/go.mod b/go.mod
index 3c9a07193..f375cbe1a 100644
--- a/go.mod
+++ b/go.mod
@@ -170,4 +170,4 @@ require (
software.sslmate.com/src/go-pkcs12 v0.2.0 // indirect
)
-go 1.22.6
+go 1.23
diff --git a/scripts/fork_go_templates/main.go b/scripts/fork_go_templates/main.go
index c4dad3224..cd461043c 100644
--- a/scripts/fork_go_templates/main.go
+++ b/scripts/fork_go_templates/main.go
@@ -16,7 +16,7 @@ import (
)
func main() {
- // The current is built with 6885bad7dd86880be6929c02085e5c7a67ff2887 go1.23.0
+ // The current is built with 3901409b5d [release-branch.go1.24] go1.24.0
// TODO(bep) preserve the staticcheck.conf file.
fmt.Println("Forking ...")
defer fmt.Println("Done ...")
@@ -216,6 +216,7 @@ func rewrite(filename, rule string) {
}
func goimports(dir string) {
+ // Needs go install golang.org/x/tools/cmd/goimports@latest
cmf, _ := hexec.SafeCommand("goimports", "-w", dir)
out, err := cmf.CombinedOutput()
if err != nil {
diff --git a/tpl/internal/go_templates/cfg/cfg.go b/tpl/internal/go_templates/cfg/cfg.go
index 08d210b79..932976972 100644
--- a/tpl/internal/go_templates/cfg/cfg.go
+++ b/tpl/internal/go_templates/cfg/cfg.go
@@ -37,12 +37,14 @@ const KnownEnv = `
GOARCH
GOARM
GOARM64
+ GOAUTH
GOBIN
GOCACHE
GOCACHEPROG
GOENV
GOEXE
GOEXPERIMENT
+ GOFIPS140
GOFLAGS
GOGCCFLAGS
GOHOSTARCH
diff --git a/tpl/internal/go_templates/htmltemplate/clone_test.go b/tpl/internal/go_templates/htmltemplate/clone_test.go
index e42177a6b..7db335b5b 100644
--- a/tpl/internal/go_templates/htmltemplate/clone_test.go
+++ b/tpl/internal/go_templates/htmltemplate/clone_test.go
@@ -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 !windows
-// +build !windows
+//go:build go1.13 && !windows
+// +build go1.13,!windows
package template
diff --git a/tpl/internal/go_templates/htmltemplate/content_test.go b/tpl/internal/go_templates/htmltemplate/content_test.go
index e886ee8ff..fac4774cc 100644
--- a/tpl/internal/go_templates/htmltemplate/content_test.go
+++ b/tpl/internal/go_templates/htmltemplate/content_test.go
@@ -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 !windows
-// +build !windows
+//go:build go1.13 && !windows
+// +build go1.13,!windows
package template
@@ -428,7 +428,7 @@ func TestStringer(t *testing.T) {
if err := tmpl.Execute(b, s); err != nil {
t.Fatal(err)
}
- expect := "string=3"
+ var expect = "string=3"
if b.String() != expect {
t.Errorf("expected %q got %q", expect, b.String())
}
diff --git a/tpl/internal/go_templates/htmltemplate/css_test.go b/tpl/internal/go_templates/htmltemplate/css_test.go
index f2b2add3a..f44568930 100644
--- a/tpl/internal/go_templates/htmltemplate/css_test.go
+++ b/tpl/internal/go_templates/htmltemplate/css_test.go
@@ -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 !windows
-// +build !windows
+//go:build go1.13 && !windows
+// +build go1.13,!windows
package template
diff --git a/tpl/internal/go_templates/htmltemplate/escape.go b/tpl/internal/go_templates/htmltemplate/escape.go
index 334bbce0f..f5d5674fa 100644
--- a/tpl/internal/go_templates/htmltemplate/escape.go
+++ b/tpl/internal/go_templates/htmltemplate/escape.go
@@ -9,6 +9,7 @@ import (
"fmt"
"html"
"io"
+ "maps"
"regexp"
template "github.com/gohugoio/hugo/tpl/internal/go_templates/texttemplate"
@@ -145,7 +146,7 @@ func (e *escaper) escape(c context, n parse.Node) context {
return c
case *parse.ContinueNode:
c.n = n
- e.rangeContext.continues = append(e.rangeContext.breaks, c)
+ e.rangeContext.continues = append(e.rangeContext.continues, c)
return context{state: stateDead}
case *parse.IfNode:
return e.escapeBranch(c, &n.BranchNode, "if")
@@ -588,22 +589,14 @@ func (e *escaper) escapeListConditionally(c context, n *parse.ListNode, filter f
e1 := makeEscaper(e.ns)
e1.rangeContext = e.rangeContext
// Make type inferences available to f.
- for k, v := range e.output {
- e1.output[k] = v
- }
+ maps.Copy(e1.output, e.output)
c = e1.escapeList(c, n)
ok := filter != nil && filter(&e1, c)
if ok {
// Copy inferences and edits from e1 back into e.
- for k, v := range e1.output {
- e.output[k] = v
- }
- for k, v := range e1.derived {
- e.derived[k] = v
- }
- for k, v := range e1.called {
- e.called[k] = v
- }
+ maps.Copy(e.output, e1.output)
+ maps.Copy(e.derived, e1.derived)
+ maps.Copy(e.called, e1.called)
for k, v := range e1.actionNodeEdits {
e.editActionNode(k, v)
}
diff --git a/tpl/internal/go_templates/htmltemplate/escape_test.go b/tpl/internal/go_templates/htmltemplate/escape_test.go
index 66bf50203..a5a810ffc 100644
--- a/tpl/internal/go_templates/htmltemplate/escape_test.go
+++ b/tpl/internal/go_templates/htmltemplate/escape_test.go
@@ -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 !windows
-// +build !windows
+//go:build go1.13 && !windows
+// +build go1.13,!windows
package template
@@ -944,6 +944,7 @@ func TestEscapeSet(t *testing.T) {
t.Errorf("want\n\t%q\ngot\n\t%q", test.want, got)
}
}
+
}
func TestErrors(t *testing.T) {
@@ -1064,6 +1065,10 @@ func TestErrors(t *testing.T) {
"{{range .Items}}{{end}}",
"z:1:29: at range loop continue: {{range}} branches end in different contexts",
},
+ {
+ "{{range .Items}}{{if .X}}{{break}}{{end}}{{if .Z}}{{continue}}{{end}}{{end}}",
+ "z:1:54: at range loop continue: {{range}} branches end in different contexts",
+ },
{
"no rows
//