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

Fix writing enum values in Go #233

Merged
merged 2 commits into from
Feb 28, 2025
Merged

Fix writing enum values in Go #233

merged 2 commits into from
Feb 28, 2025

Conversation

edif2008
Copy link
Member

Summary

This PR fixes generating Algebraic Rust Enums in Go to properly set the constant values according to the serde configuration for that enum.

Background

For Algebraic Rust Enums, when generating them in Go, the values of the constants were the original name of the enum variant instead of the renamed one, which takes into consideration the serde attributes. Because of that, it could happen that in such enums the JSON unmarshalling will fail due to not having any content to process. That was caused by the match case not hitting any variant.

For Algebraic Rust Enums, when generating them in Go, the values of the constants were the original name of the enum variant instead of the renamed one, which takes into consideration the serde attributes. Because of that, it could happen that in such enums the unmarshaling of JSON will fail due to not having any content to process. That was caused by the match case not hitting any variant.
@edif2008 edif2008 merged commit 6528569 into main Feb 28, 2025
6 checks passed
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