(id string, data interface{})
| 46 | } |
| 47 | |
| 48 | func NewNode(id string, data interface{}) *Node { |
| 49 | return &Node{ |
| 50 | ID: id, |
| 51 | Data: data, |
| 52 | |
| 53 | Parents: make([]*Node, 0, 1), |
| 54 | Childs: make([]*Node, 0, 1), |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | // InsertNodeAt inserts a new node at the given parent position |
| 59 | func (g *Graph) InsertNodeAt(parentID string, id string, data interface{}) (*Node, error) { |
no outgoing calls