core icon indicating copy to clipboard operation
core copied to clipboard

Tests failing to build with go 1.24

Open pterjan opened this issue 5 months ago • 0 comments

github.com/efficientgo/core/errors
# github.com/efficientgo/core/errors_test
# [github.com/efficientgo/core/errors_test]
./errors_test.go:100:35: non-constant format string in call to github.com/efficientgo/core/errors.Wrapf
FAIL	github.com/efficientgo/core/errors [build failed]

This is in the test verifying it does not generate an error when the cause is nil, however it is passing a format string (that ends up unused) and no parameter, which is no longer allowed.

This fixes the build of this file:

-       testutil.Ok(t, errors.Wrapf(nil, fmtWrapper))
+       testutil.Ok(t, errors.Wrapf(nil, fmtWrapper, "value"))

However now another test fails to build and I haven't checked it yet:

github.com/efficientgo/core/testutil
# github.com/efficientgo/core/testutil
# [github.com/efficientgo/core/testutil]
./testutil.go:42:87: non-constant format string in call to github.com/efficientgo/core/testutil.withLimitf
./testutil.go:57:112: non-constant format string in call to github.com/efficientgo/core/testutil.withLimitf
./testutil.go:72:120: non-constant format string in call to github.com/efficientgo/core/testutil.withLimitf
./testutil.go:93:41: non-constant format string in call to github.com/efficientgo/core/testutil.withLimitf
./testutil.go:93:106: non-constant format string in call to github.com/efficientgo/core/testutil.withLimitf
FAIL	github.com/efficientgo/core/testutil [build failed]

pterjan avatar Jul 06 '25 16:07 pterjan