MCPcopy Create free account
hub / github.com/driangle/taskmd / collectChildrenTree

Function collectChildrenTree

apps/cli/internal/cli/status.go:308–328  ·  view source on GitHub ↗
(taskID string, index map[string][]*model.Task, visited map[string]bool)

Source from the content-addressed store, hash-verified

306}
307
308func collectChildrenTree(taskID string, index map[string][]*model.Task, visited map[string]bool) []statusChild {
309 children := index[taskID]
310 if len(children) == 0 {
311 return nil
312 }
313 result := make([]statusChild, 0, len(children))
314 for _, child := range children {
315 if visited[child.ID] {
316 continue
317 }
318 visited[child.ID] = true
319 sc := statusChild{
320 ID: child.ID,
321 Title: child.Title,
322 Status: string(child.Status),
323 }
324 sc.Children = collectChildrenTree(child.ID, index, visited)
325 result = append(result, sc)
326 }
327 return result
328}
329
330func outputStatusText(out statusOutput, w io.Writer) error {
331 r := getRenderer()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected