Skip to content

fix: add go.mod and fix non-constant format string warnings in tests - #252

Open
aoright wants to merge 1 commit into
pkg:masterfrom
aoright:fix/test-wrapf-withmessagef-format-and-go-mod
Open

fix: add go.mod and fix non-constant format string warnings in tests#252
aoright wants to merge 1 commit into
pkg:masterfrom
aoright:fix/test-wrapf-withmessagef-format-and-go-mod

Conversation

@aoright

@aoright aoright commented Aug 20, 2026

Copy link
Copy Markdown

Problem

  1. errors_test.go triggers compiler / go vet errors on modern Go due to passing dynamic format strings directly to Wrapf and WithMessagef in test table loops without format specifiers (non-constant format string in call to Wrapf).
  2. Lack of go.mod definition causes module-aware tooling to fail.

Fix

  • Define go.mod for github.com/pkg/errors.
  • Pass explicit "%s" format specifier to Wrapf in TestWrapf and WithMessagef in TestWithMessagef.

Signed-off-by: aoright <102943475+aoright@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant