From 735182923845a69e4f822eb7f9dee108cd0a64fc Mon Sep 17 00:00:00 2001 From: karamaru-alpha Date: Thu, 19 Oct 2023 13:20:14 +0900 Subject: [PATCH] Fix lint/go errors (gosimple) Signed-off-by: karamaru-alpha --- pkg/app/piped/driftdetector/cloudrun/detector.go | 2 +- .../platformprovider/terraform/terraform.go | 16 ++++------------ pkg/model/application_live_state.go | 1 - 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/pkg/app/piped/driftdetector/cloudrun/detector.go b/pkg/app/piped/driftdetector/cloudrun/detector.go index a3fb460a3e..d707570f40 100644 --- a/pkg/app/piped/driftdetector/cloudrun/detector.go +++ b/pkg/app/piped/driftdetector/cloudrun/detector.go @@ -315,7 +315,7 @@ func makeSyncState(r *provider.DiffResult, commit string) model.ApplicationSyncS } } - shortReason := fmt.Sprintf("The service manifest doesn't be synced") + shortReason := "The service manifest doesn't be synced" if len(commit) >= 7 { commit = commit[:7] } diff --git a/pkg/app/piped/platformprovider/terraform/terraform.go b/pkg/app/piped/platformprovider/terraform/terraform.go index 2b9679f38f..8a497d916b 100644 --- a/pkg/app/piped/platformprovider/terraform/terraform.go +++ b/pkg/app/piped/platformprovider/terraform/terraform.go @@ -120,9 +120,7 @@ func (t *Terraform) Init(ctx context.Context, w io.Writer) error { "init", } args = append(args, t.makeCommonCommandArgs()...) - for _, f := range t.options.initFlags { - args = append(args, f) - } + args = append(args, t.options.initFlags...) cmd := exec.CommandContext(ctx, t.execPath, args...) cmd.Dir = t.dir @@ -278,9 +276,7 @@ func (t *Terraform) Plan(ctx context.Context, w io.Writer) (PlanResult, error) { "-detailed-exitcode", } args = append(args, t.makeCommonCommandArgs()...) - for _, f := range t.options.planFlags { - args = append(args, f) - } + args = append(args, t.options.planFlags...) var buf bytes.Buffer stdout := io.MultiWriter(w, &buf) @@ -316,9 +312,7 @@ func (t *Terraform) makeCommonCommandArgs() (args []string) { for _, f := range t.options.varFiles { args = append(args, fmt.Sprintf("-var-file=%s", f)) } - for _, f := range t.options.sharedFlags { - args = append(args, f) - } + args = append(args, t.options.sharedFlags...) return } @@ -398,9 +392,7 @@ func (t *Terraform) Apply(ctx context.Context, w io.Writer) error { "-input=false", } args = append(args, t.makeCommonCommandArgs()...) - for _, f := range t.options.applyFlags { - args = append(args, f) - } + args = append(args, t.options.applyFlags...) cmd := exec.CommandContext(ctx, t.execPath, args...) cmd.Dir = t.dir diff --git a/pkg/model/application_live_state.go b/pkg/model/application_live_state.go index 933797b2d1..077bbea2d3 100644 --- a/pkg/model/application_live_state.go +++ b/pkg/model/application_live_state.go @@ -68,7 +68,6 @@ func (s *ApplicationLiveStateSnapshot) DetermineAppHealthStatus() { case ApplicationKind_CLOUDRUN: s.determineCloudRunAppHealthStatus() } - return } func (s *ApplicationLiveStateSnapshot) determineKubernetesAppHealthStatus() {