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

Method initialize

go/engine/scope.go:138–147  ·  view source on GitHub ↗

initialize declares and sets user-declared variables in the scope.

(vars []workflow.Variable)

Source from the content-addressed store, hash-verified

136
137// initialize declares and sets user-declared variables in the scope.
138func (s *Scope) initialize(vars []workflowapi.Variable) error {
139 for _, v := range vars {
140 val, err := expr.Coerce(v.DataType, v.InitialValue)
141 if err != nil {
142 return fmt.Errorf("declared variable %q: %w", v.Uid, err)
143 }
144 s.Set(SrcDeclared, v.Uid, val)
145 }
146 return nil
147}

Callers 2

NewMainScopeFunction · 0.95
NewFunctionScopeFunction · 0.95

Calls 1

SetMethod · 0.95

Tested by

no test coverage detected