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

Support for automatically parsing XML or binary plists. #20

Closed
wants to merge 1 commit into from

Conversation

jpap
Copy link
Contributor

@jpap jpap commented Sep 26, 2019

This PR introduces a new constructor NewAutoDecoder to provide a Decoder that will automatically detect whether we are decoding an XML or binary plist.

The deprecated function NewDecoder is redirected to the new constructor above.

This PR addresses #17.

return NewXMLDecoder(r)
d, err := NewAutoDecoder(r)
if err != nil {
panic(err)
Copy link
Member

Choose a reason for hiding this comment

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

IMO this panic would be unexpected. Lets add the new function but leave the deprecated one as is.

@jessepeterson
Copy link
Member

Hello @jpap sorry for the delay! We'd be open to an auto-decoder, but @groob changes here would need to be made. That is: leave the existing decoder alone and not use panic(). I'm gonna close this for now, but feel free to either update or submit new with those fixes. 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.

3 participants