String returns a string representation of the DAG in topology order
()
| 269 | |
| 270 | // String returns a string representation of the DAG in topology order |
| 271 | func (d *DAG) String() string { |
| 272 | str := "|" |
| 273 | walkFunc := func(v Vertex) error { |
| 274 | str += fmt.Sprintf("->%v", v) |
| 275 | return nil |
| 276 | } |
| 277 | if err := d.WalkReverseTopoOrder(walkFunc, nil); err != nil { |
| 278 | return "->err" |
| 279 | } |
| 280 | return str |
| 281 | } |
| 282 | |
| 283 | // Validate 'd' has single Root and has no cycles |
| 284 | func (d *DAG) Validate() error { |