Repository navigation
Conversation
message will have no args
kennytm
force-pushed
the
kennytm/fix-86
branch
from
October 27, 2026 08:20
3f31157 to
8c85ea1
Compare
Collaborator
Author
|
PTAL @crazycs520 breaking change, but imo the existing usages broken by this are wrong anyway as explained in #86. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the changes to literal error-message handling and JSON-decoding state reset.
No open issues 🎉
What changed in this PR
Addresses #86 by keeping cause-derived and JSON-decoded error messages literal, preventing stale arguments from formatting them.
Changes:
- Removes arguments from
FastGenWithCauseandGenWithStackByCause, directing template formatting to the existingByArgsmethods. - Clears formatting arguments and other local state after successful JSON unmarshalling.
- Updates tests for literal percent sequences, redaction, state reset, and preservation of existing errors on invalid JSON.
| File | Description |
|---|---|
normalize.go |
Makes cause-based generators argument-free and clears arguments when copying cause text. |
normalize_test.go |
Updates cause-generation tests for literal messages and the revised API. |
compatible_shim.go |
Clears stale local state after successful JSON decoding. |
compatible_shim_test.go |
Adds state-reset, literal-message round-trip, and invalid-input tests. |
Review effort: Balanced
Collaborator
Author
|
separating this into 2 PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #86