Move type construction out, delete func
This commit is contained in:
parent
dd6fb16971
commit
fa3b54c0c4
|
@ -162,7 +162,11 @@ func (r *RawConfig) Interpolate(vs map[string]ast.Variable) error {
|
||||||
r.lock.Lock()
|
r.lock.Lock()
|
||||||
defer r.lock.Unlock()
|
defer r.lock.Unlock()
|
||||||
|
|
||||||
config := langEvalConfig(vs)
|
config := &hil.EvalConfig{
|
||||||
|
GlobalScope: &ast.BasicScope{
|
||||||
|
VarMap: vs,
|
||||||
|
},
|
||||||
|
}
|
||||||
return r.interpolate(func(root ast.Node) (interface{}, error) {
|
return r.interpolate(func(root ast.Node) (interface{}, error) {
|
||||||
// None of the variables we need are computed, meaning we should
|
// None of the variables we need are computed, meaning we should
|
||||||
// be able to properly evaluate.
|
// be able to properly evaluate.
|
||||||
|
@ -399,12 +403,3 @@ type gobRawConfig struct {
|
||||||
Key string
|
Key string
|
||||||
Raw map[string]interface{}
|
Raw map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// langEvalConfig returns the evaluation configuration we use to execute.
|
|
||||||
func langEvalConfig(vs map[string]ast.Variable) *hil.EvalConfig {
|
|
||||||
return &hil.EvalConfig{
|
|
||||||
GlobalScope: &ast.BasicScope{
|
|
||||||
VarMap: vs,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue