Move type construction out, delete func

This commit is contained in:
Pam Selle 2020-03-02 15:54:50 -05:00
parent dd6fb16971
commit fa3b54c0c4
1 changed files with 5 additions and 10 deletions

View File

@ -162,7 +162,11 @@ func (r *RawConfig) Interpolate(vs map[string]ast.Variable) error {
r.lock.Lock()
defer r.lock.Unlock()
config := langEvalConfig(vs)
config := &hil.EvalConfig{
GlobalScope: &ast.BasicScope{
VarMap: vs,
},
}
return r.interpolate(func(root ast.Node) (interface{}, error) {
// None of the variables we need are computed, meaning we should
// be able to properly evaluate.
@ -399,12 +403,3 @@ type gobRawConfig struct {
Key string
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,
},
}
}