10 // An example showing how to unmarshal embedded
18 // Embedded structs are not treated as embedded in YAML by default. To do that,
19 // add the ",inline" annotation below
20 StructA `yaml:",inline"`
25 a: a string from struct A
26 b: a string from struct B
29 func ExampleUnmarshal_embedded() {
32 err := yaml.Unmarshal([]byte(data), &b)
34 log.Fatal("cannot unmarshal data: %v", err)
39 // a string from struct A
40 // a string from struct B