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

Function getMissingRequiredVars

requires.go:150–161  ·  view source on GitHub ↗

getMissingRequiredVars returns required vars that are not set in the task's vars.

(t *ast.Task)

Source from the content-addressed store, hash-verified

148
149// getMissingRequiredVars returns required vars that are not set in the task's vars.
150func getMissingRequiredVars(t *ast.Task) []*ast.VarsWithValidation {
151 if t.Requires == nil {
152 return nil
153 }
154 var missing []*ast.VarsWithValidation
155 for _, v := range t.Requires.Vars {
156 if _, ok := t.Vars.Get(v.Name); !ok {
157 missing = append(missing, v)
158 }
159 }
160 return missing
161}
162
163func (e *Executor) areTaskRequiredVarsSet(t *ast.Task) error {
164 missing := getMissingRequiredVars(t)

Callers 3

promptDepsVarsMethod · 0.85
promptTaskVarsMethod · 0.85

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…