lang: ast: Fix data race in ExprSingleton
Init the mutex everywhere, but consider calling Init instead and plumbing though the data input field in the future.
This commit is contained in:
committed by
James Shubin
parent
c4a9560d53
commit
3553eb1f2a
@@ -169,6 +169,7 @@ func (obj *Lang) Init() error {
|
||||
// TODO: change to a func when we can change hostname dynamically!
|
||||
"hostname": &ast.ExprStr{V: obj.Hostname},
|
||||
}
|
||||
// TODO: pass `data` into ast.VarPrefixToVariablesScope ?
|
||||
consts := ast.VarPrefixToVariablesScope(vars.ConstNamespace) // strips prefix!
|
||||
addback := vars.ConstNamespace + interfaces.ModuleSep // add it back...
|
||||
variables, err = ast.MergeExprMaps(variables, consts, addback)
|
||||
|
||||
Reference in New Issue
Block a user