MCPcopy
hub / github.com/go-task/task / NewTasks

Function NewTasks

taskfile/ast/tasks.go:31–39  ·  view source on GitHub ↗

NewTasks creates a new instance of Tasks and initializes it with the provided set of elements, if any. The elements are added in the order they are passed.

(els ...*TaskElement)

Source from the content-addressed store, hash-verified

29// NewTasks creates a new instance of Tasks and initializes it with the provided
30// set of elements, if any. The elements are added in the order they are passed.
31func NewTasks(els ...*TaskElement) *Tasks {
32 tasks := &Tasks{
33 om: orderedmap.NewOrderedMap[string, *Task](),
34 }
35 for _, el := range els {
36 tasks.Set(el.Key, el.Value)
37 }
38 return tasks
39}
40
41// Len returns the number of variables in the Tasks map.
42func (tasks *Tasks) Len() int {

Callers 5

TestPrintAllWithSpacesFunction · 0.92
SetMethod · 0.85
UnmarshalYAMLMethod · 0.85
MergeMethod · 0.85
UnmarshalYAMLMethod · 0.85

Calls 1

SetMethod · 0.95

Tested by 1

TestPrintAllWithSpacesFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…