From 98ad9b3c03278d0af3ebd13f8ec9fc1a71d46745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sun, 7 Jun 2026 11:49:30 +0200 Subject: [PATCH] Only support the latest Go version Which is currently Go 1.26. Closes #14997 --- .github/workflows/test.yml | 2 +- README.md | 2 +- commands/hugobuilder.go | 4 ++-- common/hstore/scratch_test.go | 10 +++------- go.mod | 2 +- resources/images/config.go | 6 +++--- 6 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fabf06820..425cc5be5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: test: strategy: matrix: - go-version: [1.25.x, 1.26.x] + go-version: [1.26.x] os: [ubuntu-latest, windows-latest] # macos disabled for now because of disk space issues. runs-on: ${{ matrix.os }} steps: diff --git a/README.md b/README.md index cec55af1e..4a70b3e21 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ Install Hugo from a [prebuilt binary][], package manager, or package repository. To build Hugo from source you must install: 1. [Git][] -1. [Go][] version 1.25.0 or later +1. [Go][] version 1.26.0 or later ### Standard edition diff --git a/commands/hugobuilder.go b/commands/hugobuilder.go index 563ec98bc..2ffe3fa58 100644 --- a/commands/hugobuilder.go +++ b/commands/hugobuilder.go @@ -367,7 +367,7 @@ func (c *hugoBuilder) newWatcher(pollIntervalStr string, dirList ...string) (*wa case changes := <-c.r.changesFromBuild: unlock, err := h.LockBuild() if err != nil { - c.r.logger.Errorln("Failed to acquire a build lock: %s", err) + c.r.logger.Errorf("Failed to acquire a build lock: %s", err) return } c.changeDetector.PrepareNew() @@ -387,7 +387,7 @@ func (c *hugoBuilder) newWatcher(pollIntervalStr string, dirList ...string) (*wa case evs := <-watcher.Events: unlock, err := h.LockBuild() if err != nil { - c.r.logger.Errorln("Failed to acquire a build lock: %s", err) + c.r.logger.Errorf("Failed to acquire a build lock: %s", err) return } c.handleEvents(watcher, staticSyncer, evs, configSet) diff --git a/common/hstore/scratch_test.go b/common/hstore/scratch_test.go index 1f08d46a9..d3790ebac 100644 --- a/common/hstore/scratch_test.go +++ b/common/hstore/scratch_test.go @@ -14,7 +14,6 @@ package hstore import ( - "reflect" "sync" "testing" @@ -69,9 +68,8 @@ func TestScratchAddSlice(t *testing.T) { sl := scratch.Get("intSlice") expected := []int{1, 2, 3} - if !reflect.DeepEqual(expected, sl) { - t.Errorf("Slice difference, go %q expected %q", sl, expected) - } + c.Assert(sl, qt.DeepEquals, expected) + _, err = scratch.Add("intSlice", []int{4, 5}) c.Assert(err, qt.IsNil) @@ -79,9 +77,7 @@ func TestScratchAddSlice(t *testing.T) { sl = scratch.Get("intSlice") expected = []int{1, 2, 3, 4, 5} - if !reflect.DeepEqual(expected, sl) { - t.Errorf("Slice difference, go %q expected %q", sl, expected) - } + c.Assert(sl, qt.DeepEquals, expected) } // https://github.com/gohugoio/hugo/issues/5275 diff --git a/go.mod b/go.mod index da9c47688..5f24b36a9 100644 --- a/go.mod +++ b/go.mod @@ -191,4 +191,4 @@ require ( software.sslmate.com/src/go-pkcs12 v0.7.0 // indirect ) -go 1.25.0 +go 1.26.0 diff --git a/resources/images/config.go b/resources/images/config.go index 93454c222..a9e60cac6 100644 --- a/resources/images/config.go +++ b/resources/images/config.go @@ -248,7 +248,7 @@ func DecodeConfig(in map[string]any) (*config.ConfigNamespace[ImagingConfig, Ima if i.Imaging.Anchor != "" { anchor, found := anchorPositions[i.Imaging.Anchor] if !found { - return i, nil, fmt.Errorf("invalid anchor value %q in imaging config", i.Anchor) + return i, nil, fmt.Errorf("invalid anchor value %q in imaging config", i.Imaging.Anchor) } i.Anchor = anchor } @@ -484,14 +484,14 @@ func (i *ImagingConfigInternal) Compile(externalCfg *ImagingConfig) error { if externalCfg.Anchor != "" { anchor, found := anchorPositions[externalCfg.Anchor] if !found { - return fmt.Errorf("invalid anchor value %q in imaging config", i.Anchor) + return fmt.Errorf("invalid anchor value %q in imaging config", externalCfg.Anchor) } i.Anchor = anchor } filter, found := imageFilters[externalCfg.ResampleFilter] if !found { - return fmt.Errorf("%q is not a valid resample filter", filter) + return fmt.Errorf("%q is not a valid resample filter", externalCfg.ResampleFilter) } i.ResampleFilter = filter