Skip to content

compatible_shim: avoid unnecessary double indirection in UnmarshalJSON() - #92

Merged
kennytm merged 1 commit into
masterfrom
kennytm/fix-unmarshal-json-double-pointer
Nov 26, 2026
Merged

kennytm merged 1 commit into
masterfrom
kennytm/fix-unmarshal-json-double-pointer

Conversation

@kennytm

@kennytm kennytm commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the JSON decoding simplification and added null-reset regression coverage.

No open issues 🎉

What changed in this PR

Simplifies JSON decoding in the legacy error compatibility shim and adds coverage for clearing an error when decoding null.

Changes:

  • Uses a value-based temporary decoding target to avoid double pointer indirection.
  • Adds a regression test confirming that JSON null resets a populated error to its zero value.
File Description
compatible_shim.go Removes unnecessary pointer indirection in UnmarshalJSON.
compatible_shim_test.go Tests that decoding null clears an existing error.

Review effort: Balanced

@kennytm
kennytm merged commit 13df028 into master Nov 26, 2026
2 checks passed
@kennytm
kennytm deleted the kennytm/fix-unmarshal-json-double-pointer branch November 26, 2026 18:05
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.

2 participants