MCPcopy Index your code
hub / github.com/go-task/task / All

Method All

taskfile/ast/tasks.go:80–95  ·  view source on GitHub ↗

All returns an iterator that loops over all task key-value pairs in the order specified by the sorter.

(sorter sort.Sorter)

Source from the content-addressed store, hash-verified

78// All returns an iterator that loops over all task key-value pairs in the order
79// specified by the sorter.
80func (t *Tasks) All(sorter sort.Sorter) iter.Seq2[string, *Task] {
81 if t == nil || t.om == nil {
82 return func(yield func(string, *Task) bool) {}
83 }
84 if sorter == nil {
85 return t.om.AllFromFront()
86 }
87 return func(yield func(string, *Task) bool) {
88 for _, key := range sorter(slices.Collect(t.om.Keys()), nil) {
89 el := t.om.GetElement(key)
90 if !yield(el.Key, el.Value) {
91 return
92 }
93 }
94 }
95}
96
97// Keys returns an iterator that loops over all task keys in the order specified
98// by the sorter.

Callers 3

KeysMethod · 0.95
ValuesMethod · 0.95
MergeMethod · 0.45

Calls 1

KeysMethod · 0.45

Tested by

no test coverage detected