Skip to content

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