7 "github.com/hashicorp/terraform/config"
10 func (t *Tree) GobDecode(bs []byte) error {
14 // Decode the gob data
16 dec := gob.NewDecoder(bytes.NewReader(bs))
17 if err := dec.Decode(&data); err != nil {
23 t.config = data.Config
24 t.children = data.Children
30 func (t *Tree) GobEncode() ([]byte, error) {
39 enc := gob.NewEncoder(&buf)
40 if err := enc.Encode(data); err != nil {
44 return buf.Bytes(), nil
47 // treeGob is used as a structure to Gob encode a tree.
49 // This structure is private so it can't be referenced but the fields are
50 // public, allowing Gob to properly encode this. When we decode this, we are
51 // able to turn it into a Tree.
54 Children map[string]*Tree