DHowett / go-plist

A pure Go Apple Property List transcoder
Other
410 stars 96 forks source link

how to define nested structure #62

Closed SolskGaer closed 3 years ago

SolskGaer commented 3 years ago

I got a nested structure that formed like <dict><dict><array><dict></dict></array></dict></dict>, and I can't get the innermost dict parsed appropriately, how do I define the struct while parsing this structure?

DHowett commented 3 years ago

Since you closed the issue, I'm guessing you figured it out?

MarSoft commented 1 year ago

It should be something like this (remember to add plist:"keyname" annotations if required).

type MyStruct struct{
    KeyName struct{
        SomeArray []struct{
            InnerDictField string
            ...
        }
    }
}