MCPcopy
hub / github.com/syncthing/syncthing / printServiceTree

Function printServiceTree

lib/syncthing/syncthing.go:444–459  ·  view source on GitHub ↗
(w io.Writer, sup supervisor, level int)

Source from the content-addressed store, hash-verified

442type supervisor interface{ Services() []suture.Service }
443
444func 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
461func printService(w io.Writer, svc interface{}, level int) {
462 type errorer interface{ Error() error }

Callers 1

stopWithErrMethod · 0.85

Calls 3

printServiceFunction · 0.85
ServicesMethod · 0.80
CompareMethod · 0.45

Tested by

no test coverage detected