From 714f4212948144087b757fa09cd9fc1bb8f6b24a Mon Sep 17 00:00:00 2001 From: "Edwin.Avalos" Date: Mon, 19 Dec 2016 19:44:51 -0600 Subject: [PATCH] Combine the --target append steps No reason to waste lines --- plugin.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugin.go b/plugin.go index 19c3f79..818b291 100644 --- a/plugin.go +++ b/plugin.go @@ -130,8 +130,7 @@ func planCommand(variables map[string]string, secrets map[string]string, paralle "-out=plan.tfout", } for _, v := range targets { - args = append(args, "--target") - args = append(args, fmt.Sprintf("%s", v)) + args = append(args, "--target", fmt.Sprintf("%s", v)) } for k, v := range variables { args = append(args, "-var") @@ -155,8 +154,7 @@ func applyCommand(parallelism int, targets []string) *exec.Cmd { "apply", } for _, v := range targets { - args = append(args, "--target") - args = append(args, fmt.Sprintf("%s", v)) + args = append(args, "--target", fmt.Sprintf("%s", v)) } if parallelism > 0 { args = append(args, fmt.Sprintf("-parallelism=%d", parallelism))