Given these stucts:
type Path struct {
Description string
Paths map[string]Path
}
type Top struct {
Title string
Path
}
I should be able to unmarshal a YAML like this:
title: Recursive
paths:
a:
paths:
b:
paths:
c:
description: Bottom
This works but should be the same thing as above:
type Path struct {
Description string
Paths map[string]Path
}
type Top struct {
Title string
Paths map[string]Path
}
You need the ,inline
flag for that, as per the documentation:
http://gopkg.in/yaml.v2#Marshal
You can use that flag both on normal and on anonymous fields.
:+1: Sorry, I know: RTFM @rnix :gun:
No problem. ;-)
And thanks for submitting the issues. They might well be valid problems.
Most helpful comment
You need the
,inline
flag for that, as per the documentation:http://gopkg.in/yaml.v2#Marshal
You can use that flag both on normal and on anonymous fields.