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

Function NewVars

taskfile/ast/vars.go:27–35  ·  view source on GitHub ↗

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

(els ...*VarElement)

Source from the content-addressed store, hash-verified

25// NewVars creates a new instance of Vars and initializes it with the provided
26// set of elements, if any. The elements are added in the order they are passed.
27func NewVars(els ...*VarElement) *Vars {
28 vars := &Vars{
29 om: orderedmap.NewOrderedMap[string, Var](),
30 }
31 for _, el := range els {
32 vars.Set(el.Key, el.Value)
33 }
34 return vars
35}
36
37// Len returns the number of variables in the Vars map.
38func (vars *Vars) Len() int {

Callers 15

runMethod · 0.92
runMethod · 0.92
TestSplitArgsFunction · 0.92
compiledTaskMethod · 0.92
promptDepsVarsMethod · 0.92
promptTaskVarsMethod · 0.92
RunTaskMethod · 0.92
GetTaskMethod · 0.92
TestGroupWithBeginEndFunction · 0.92
MaskSecretsWithExtraFunction · 0.92
ReplaceVarsWithExtraFunction · 0.92

Calls 1

SetMethod · 0.95

Tested by 8

runMethod · 0.74
runMethod · 0.74
TestSplitArgsFunction · 0.74
TestGroupWithBeginEndFunction · 0.74
TestCmdParseFunction · 0.74
TestArgsFunction · 0.74
TestVars_ToCacheMapFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…