You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I end up needing to have an external func to automatically decode a binary or XML plist, see below.
It would be nice to replace the deprecated plist.NewDecoder func with this. Happy to provide a PR on your suggestion.
// NewPListDecoder returns a new Property List decoder, auto-detecting
// whether it is binary or XML text.
func NewPListDecoder(r io.ReadSeeker) *plist.Decoder {
// Detect if it XML or Binary
magic := make([]byte, 5)
n, err := r.Read(magic)
if err != nil {
return nil
}
_, err = r.Seek(0, 0)
if err != nil {
return nil
}
switch string(magic[:n]) {
case "<?xml":
return plist.NewXMLDecoder(r)
case "bplis":
return plist.NewBinaryDecoder(r)
}
return nil
}
The text was updated successfully, but these errors were encountered:
Thanks for a great package!
I end up needing to have an external func to automatically decode a binary or XML plist, see below.
It would be nice to replace the deprecated
plist.NewDecoder
func with this. Happy to provide a PR on your suggestion.The text was updated successfully, but these errors were encountered: