diff options
author | W. Michael Petullo <mike@flyn.org> | 2025-01-20 19:34:39 -0600 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2025-01-21 11:10:03 +0100 |
commit | 4b0c194fb318bc8fa38ed021d161901b7f6f7f95 (patch) | |
tree | ef1b6be14a07ce3d34efc78d842e0c06a5b974ed /common | |
parent | 8de4ffb294c511420b14bd3685c973355f69c59f (diff) | |
download | hugo-4b0c194fb318bc8fa38ed021d161901b7f6f7f95.tar.gz hugo-4b0c194fb318bc8fa38ed021d161901b7f6f7f95.zip |
Fix build with Go 1.24
Go 1.24 provides stricter checking that forbids passing a variable as
a format string to Printf-family functions with no other arguments. Remove
instances of this. See also:
https://tip.golang.org/doc/go1.24#vet
Signed-off-by: W. Michael Petullo <mike@flyn.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/hugio/hasBytesWriter_test.go | 8 | ||||
-rw-r--r-- | common/hugo/hugo.go | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/common/hugio/hasBytesWriter_test.go b/common/hugio/hasBytesWriter_test.go index 49487ab0b..f0d6c3a7b 100644 --- a/common/hugio/hasBytesWriter_test.go +++ b/common/hugio/hasBytesWriter_test.go @@ -48,16 +48,16 @@ func TestHasBytesWriter(t *testing.T) { for i := 0; i < 22; i++ { h, w := neww() - fmt.Fprintf(w, rndStr()+"abc __foobar"+rndStr()) + fmt.Fprint(w, rndStr()+"abc __foobar"+rndStr()) c.Assert(h.Patterns[0].Match, qt.Equals, true) h, w = neww() - fmt.Fprintf(w, rndStr()+"abc __f") - fmt.Fprintf(w, "oo bar"+rndStr()) + fmt.Fprint(w, rndStr()+"abc __f") + fmt.Fprint(w, "oo bar"+rndStr()) c.Assert(h.Patterns[0].Match, qt.Equals, true) h, w = neww() - fmt.Fprintf(w, rndStr()+"abc __moo bar") + fmt.Fprint(w, rndStr()+"abc __moo bar") c.Assert(h.Patterns[0].Match, qt.Equals, false) } diff --git a/common/hugo/hugo.go b/common/hugo/hugo.go index e480baa94..eecf4bc2f 100644 --- a/common/hugo/hugo.go +++ b/common/hugo/hugo.go @@ -423,7 +423,7 @@ func DeprecateLevel(item, alternative, version string, level logg.Level) { msg = fmt.Sprintf("%s was deprecated in Hugo %s and will be removed in a future release. %s", item, version, alternative) } - loggers.Log().Logger().WithLevel(level).WithField(loggers.FieldNameCmd, "deprecated").Logf(msg) + loggers.Log().Logger().WithLevel(level).WithField(loggers.FieldNameCmd, "deprecated").Logf("%s", msg) } // We usually do about one minor version a month. |