MCPcopy Create free account
hub / github.com/mmcgrana/gobyexample / Nesting

Struct Nesting

examples/xml/xml.go:59–62  ·  view source on GitHub ↗

The `parent>child>plant` field tag tells the encoder to nest all `plant`s under ` ...`

Source from the content-addressed store, hash-verified

57 // The `parent>child>plant` field tag tells the encoder
58 // to nest all `plant`s under `<parent><child>...`
59 type Nesting struct {
60 XMLName xml.Name `xml:"nesting"`
61 Plants []*Plant `xml:"parent>child>plant"`
62 }
63
64 nesting := &Nesting{}
65 nesting.Plants = []*Plant{coffee, tomato}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected