Skip to content

Tests failing to build with go 1.24 #13

@pterjan

Description

@pterjan
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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions