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

Method Set

taskfile/ast/include.go:78–88  ·  view source on GitHub ↗

Set sets the value of the include with the provided key to the provided value. If the include already exists, its value is updated. If the include does not exist, it is created.

(key string, value *Include)

Source from the content-addressed store, hash-verified

76// value. If the include already exists, its value is updated. If the include
77// does not exist, it is created.
78func (includes *Includes) Set(key string, value *Include) bool {
79 if includes == nil {
80 includes = NewIncludes()
81 }
82 if includes.om == nil {
83 includes.om = orderedmap.NewOrderedMap[string, *Include]()
84 }
85 defer includes.mutex.Unlock()
86 includes.mutex.Lock()
87 return includes.om.Set(key, value)
88}
89
90// All returns an iterator that loops over all task key-value pairs.
91// Range calls the provided function for each include in the map. The function

Callers 2

NewIncludesFunction · 0.95
UnmarshalYAMLMethod · 0.95

Calls 1

NewIncludesFunction · 0.85

Tested by

no test coverage detected