package main import ( "fmt" // "github.com/goccy/go-graphviz" "github.com/goccy/go-graphviz/cgraph" ) func walk(re RoomExit, g *cgraph.Graph) error { sg := g.SubGraph("cluster_"+re.Name.String, 1) sg.SetLabel(re.Name.String) origin, err := sg.CreateNode(re.Fromuid.String) origin.SetLabel(re.Name.String) if err != nil { return fmt.Errorf("error creating origin node: %w", err) } dest, err := sg.CreateNode(re.Touid.String) if err != nil { return fmt.Errorf("error creating destination node: %w", err) } _, err = g.CreateEdge(re.String(), origin, dest) if err != nil { return fmt.Errorf("error creating edge between origin and destination: %w", err) } return nil }