Describe the bug
MapTo() doesn't seem to handle embedded struct
To Reproduce
const INI = `
[Section]
FieldInSubSection = 1
FieldInSection = 2
`
type File struct {
Section `ini:"Section"`
}
type Section struct {
SubSection
FieldInSection string `ini:"FieldInSection"`
}
type SubSection struct {
FieldInSubSection string `ini:"FieldInSubSection"`
}
func main() {
iniFile, err := ini.Load(strings.NewReader(INI))
if err != nil {
log.Fatalf("load error: %v", err)
}
f := new(File)
iniFile.MapTo(f)
fmt.Printf("%+v", f) // FieldInSubSection is not mapped
}
https://play.golang.org/p/cymqihBewXM
Expected behavior
f.FieldInSubSection == "1"
Describe the bug
MapTo()doesn't seem to handle embedded structTo Reproduce
https://play.golang.org/p/cymqihBewXM
Expected behavior
f.FieldInSubSection == "1"