(w io.Writer, sup supervisor, level int)
| 442 | type supervisor interface{ Services() []suture.Service } |
| 443 | |
| 444 | func printServiceTree(w io.Writer, sup supervisor, level int) { |
| 445 | printService(w, sup, level) |
| 446 | |
| 447 | svcs := sup.Services() |
| 448 | slices.SortFunc(svcs, func(a, b suture.Service) int { |
| 449 | return strings.Compare(fmt.Sprint(a), fmt.Sprint(b)) |
| 450 | }) |
| 451 | |
| 452 | for _, svc := range svcs { |
| 453 | if sub, ok := svc.(supervisor); ok { |
| 454 | printServiceTree(w, sub, level+1) |
| 455 | } else { |
| 456 | printService(w, svc, level+1) |
| 457 | } |
| 458 | } |
| 459 | } |
| 460 | |
| 461 | func printService(w io.Writer, svc interface{}, level int) { |
| 462 | type errorer interface{ Error() error } |
no test coverage detected