MCPcopy Create free account
hub / github.com/ForestHubAI/edge-agents / Execute

Method Execute

go/engine/node/setvariable.go:37–44  ·  view source on GitHub ↗
(ctx context.Context, scope *engine.Scope)

Source from the content-addressed store, hash-verified

35}
36
37func (n *SetVariable) Execute(ctx context.Context, scope *engine.Scope) (string, error) {
38 val, err := expr.Eval(n.value, scope)
39 if err != nil {
40 return "", fmt.Errorf("set_variable %s: evaluating value: %w", n.ID(), err)
41 }
42 scope.Set(n.variable.SrcId, n.variable.VarId, val)
43 return n.Next(engine.PortCtrl, scope)
44}

Callers 1

TestSetVariable_ExecuteFunction · 0.95

Calls 3

NextMethod · 0.80
IDMethod · 0.65
SetMethod · 0.45

Tested by 1

TestSetVariable_ExecuteFunction · 0.76