Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix non-constant format string passed to errors.Wrapf() #424

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

ebiggers
Copy link
Collaborator

Do not pass a path as the format string argument to errors.Wrapf(), as this causes it to be misinterpreted as a format string, causing an unexpected message if the path contains something like '%s'. Instead use errors.Wrap(). This was diagnosed by Go 1.24.

Fixes #422

Do not pass a path as the format string argument to errors.Wrapf(), as
this causes it to be misinterpreted as a format string, causing an
unexpected message if the path contains something like '%s'.  Instead
use errors.Wrap().  This was diagnosed by Go 1.24.

Fixes #422
@ebiggers ebiggers merged commit 57a749b into master Feb 17, 2025
10 checks passed
@ebiggers ebiggers deleted the fix-non-const-format-string branch February 17, 2025 22:51
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.

non-constant format string diagnostic in Go 1.24
1 participant