Set sets the value of the variable with the provided key to the provided value. If the variable already exists, its value is updated. If the variable does not exist, it is created.
(key string, value Var)
| 60 | // value. If the variable already exists, its value is updated. If the variable |
| 61 | // does not exist, it is created. |
| 62 | func (vars *Vars) Set(key string, value Var) bool { |
| 63 | if vars == nil { |
| 64 | vars = NewVars() |
| 65 | } |
| 66 | if vars.om == nil { |
| 67 | vars.om = orderedmap.NewOrderedMap[string, Var]() |
| 68 | } |
| 69 | defer vars.mutex.Unlock() |
| 70 | vars.mutex.Lock() |
| 71 | return vars.om.Set(key, value) |
| 72 | } |
| 73 | |
| 74 | // All returns an iterator that loops over all task key-value pairs. |
| 75 | func (vars *Vars) All() iter.Seq2[string, Var] { |