From ce2f18b59fcdf662d2377d8bc46b5cefd69a8562 Mon Sep 17 00:00:00 2001 From: Katy Moe Date: Mon, 6 Jul 2020 16:15:12 +0100 Subject: [PATCH] gofmt, vet --- tfexec/terraform.go | 6 +++--- tfexec/terraform_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tfexec/terraform.go b/tfexec/terraform.go index 609b98dd..fc40771d 100644 --- a/tfexec/terraform.go +++ b/tfexec/terraform.go @@ -535,7 +535,7 @@ type OutputMeta struct { Value json.RawMessage `json:"value"` } -func (tf *Terraform) Output(ctx context.Context, opts ...OutputOption) (map[string]OutputMeta, error) { +func (tf *Terraform) Output(ctx context.Context, opts ...OutputOption) (*map[string]OutputMeta, error) { outputCmd := tf.OutputCmd(ctx, opts...) var errBuf strings.Builder @@ -551,12 +551,12 @@ func (tf *Terraform) Output(ctx context.Context, opts ...OutputOption) (map[stri return nil, parseError(err.Error()) } - err = json.Unmarshal(outBuf.Bytes(), outputs) + err = json.Unmarshal(outBuf.Bytes(), &outputs) if err != nil { return nil, err } - return outputs, nil + return &outputs, nil } func (tf *Terraform) StateShow(ctx context.Context) (*tfjson.State, error) { diff --git a/tfexec/terraform_test.go b/tfexec/terraform_test.go index fb6c425a..ee1ef59e 100644 --- a/tfexec/terraform_test.go +++ b/tfexec/terraform_test.go @@ -351,7 +351,7 @@ func TestStateShow(t *testing.T) { TerraformVersion: "0.12.24", Values: &tfjson.StateValues{ RootModule: &tfjson.StateModule{ - Resources: []*tfjson.StateResource{&tfjson.StateResource{ + Resources: []*tfjson.StateResource{{ Address: "null_resource.foo", AttributeValues: map[string]interface{}{ "id": "5510719323588825107",