From 1fda88ed56bcbf948d31573c8460ddb422e1c5ee Mon Sep 17 00:00:00 2001 From: Ben Drucker Date: Thu, 7 May 2020 22:38:22 -0700 Subject: [PATCH] reuse emptySchema, set directly to Block --- terraform/eval_validate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/eval_validate.go b/terraform/eval_validate.go index 5cfa2f46d..fb570a4f5 100644 --- a/terraform/eval_validate.go +++ b/terraform/eval_validate.go @@ -78,7 +78,7 @@ func (n *EvalValidateProvider) Eval(ctx EvalContext) (interface{}, error) { configBody := buildProviderConfig(ctx, n.Addr, n.Config) - emptySchema := providers.Schema{}.Block + emptySchema := &configschema.Block{} _, _, evalDiags := ctx.EvaluateBlock(configBody, emptySchema, nil, EvalDataForNoInstanceKey) if !evalDiags.HasErrors() { return nil, nil @@ -95,7 +95,7 @@ func (n *EvalValidateProvider) Eval(ctx EvalContext) (interface{}, error) { // Should never happen in real code, but often comes up in tests where // mock schemas are being used that tend to be incomplete. log.Printf("[WARN] EvalValidateProvider: no config schema is available for %s, so using empty schema", n.Addr) - configSchema = &configschema.Block{} + configSchema = emptySchema } configVal, configBody, evalDiags := ctx.EvaluateBlock(configBody, configSchema, nil, EvalDataForNoInstanceKey)