24 lines
555 B
Go
24 lines
555 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
// PrettyPrintGraph prints the entire graph in a readable format
|
|
func PrettyPrintGraph(graph *Graph) {
|
|
// Print start split
|
|
printSplit(graph.Start, 0)
|
|
}
|
|
|
|
// printSplit prints a split and its dependencies recursively with proper indentation
|
|
func printSplit(split *Split, indent int) {
|
|
// Print split information
|
|
fmt.Printf("%s- %s (%s)\n", strings.Repeat(" ", indent), split.Name, split.State)
|
|
|
|
// Recursively print dependencies
|
|
for _, dep := range split.Dependencies {
|
|
printSplit(dep, indent+1)
|
|
}
|
|
}
|