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

Prevent panic on self-referencing structs/map/slices during Marshal #705

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tsuperis3112
Copy link

This PR fixes a bug in Marshal where it would panic when attempting to serialize self-referencing structs or slices.

Previously, encountering these data structures would cause a panic, making it difficult to handle these situations gracefully. This change modifies Marshal to return an error instead, providing a more consistent and predictable way to handle serialization errors. This aligns the behavior with json.Marshal, which also returns an error when encountering self-referencing data structures.

This improvement enhances the robustness of the library and makes it easier to handle potential errors during serialization.

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