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

XMLCodec: fix DecodeValue to return a []byte #2228

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jackc
Copy link
Owner

@jackc jackc commented Jan 11, 2025

Previously, DecodeValue would always return nil with the default Unmarshal function.

fixes #2227

Previously, DecodeValue would always return nil with the default
Unmarshal function.

fixes #2227
@jackc jackc force-pushed the fix-xml-decode-value branch from 6e4f2eb to 329cb45 Compare January 11, 2025 16:55
@felix-roehrich
Copy link
Contributor

While this does fix this specific issue, it no longer respects a custom Unmarshal. Thus it is backward incompatible, i.e. a breaking change. While I don't believe that somebody ever relied on this, I think the proper change would be to update the default codec.

This preserves backwards compatibility in the unlikely event someone is
using an alternative XML unmarshaler that does support unmarshalling
into *any.
@jackc
Copy link
Owner Author

jackc commented Jan 11, 2025

@felix-roehrich It does seem very unlikely... but I suppose the fix could be implemented in the default Unmarshal function for the codec which does preserve the existing behavior.

Copy link
Contributor

@felix-roehrich felix-roehrich left a comment

Choose a reason for hiding this comment

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

Thanks!

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.

XMLCodec.DecodeValue always returns nil
2 participants