Skip to content
vetkitChecksChangelogDocumentation

vetkit.go.quality.errors-new-sprintf

errors.New(fmt.Sprintf(...)) is a roundabout fmt.Errorf(...) and cannot wrap errors with %w.

Last updated:

Suite: Code quality

go

errors.New(fmt.Sprintf(...)) is a roundabout fmt.Errorf(...) and cannot wrap errors with %w.

Category: QUALITY · Engine rule severity: INFO

How to fix it

Use fmt.Errorf(...), with %w when wrapping another error.

Rule pattern example

The engine’s matching pattern, not a confirmed exploit. Metavariables and ellipses describe matching syntax.

errors.New(fmt.Sprintf(...))

References

Source: packages/engine/rules/quality/go.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.