initialize declares and sets user-declared variables in the scope.
(vars []workflow.Variable)
| 136 | |
| 137 | // initialize declares and sets user-declared variables in the scope. |
| 138 | func (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 | } |
no test coverage detected