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

Message.Marshal() does not return an error for rootless messages #574

Open
rmmh opened this issue Jun 27, 2024 · 1 comment
Open

Message.Marshal() does not return an error for rootless messages #574

rmmh opened this issue Jun 27, 2024 · 1 comment

Comments

@rmmh
Copy link

rmmh commented Jun 27, 2024

Is there ever a reason you'd want to marshal a message without setting its root? It took me a while to discover why I couldn't Unmarshal the resulting bytes.

@matheusd
Copy link
Contributor

Ultimately, that's a mix of an implementation and API issue. I can't think of a reason to marshal a rootless message.

The underlying issue is that the current API for new messages already allocates the space for the root pointer (but doesn't make it point anywhere), so that's why you get a weird stream instead of a nil, len(0) or error.

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

No branches or pull requests

2 participants