From c01809d7e506bcd007fa0322bfa9683f2f494df7 Mon Sep 17 00:00:00 2001 From: Andrea Zucchini Date: Tue, 20 Aug 2024 12:32:40 +0100 Subject: [PATCH] chore: omit redundant nil check on slice when checking its length --- pkg/providers/tf/upgrade.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/providers/tf/upgrade.go b/pkg/providers/tf/upgrade.go index 5c66947d6..c763185f2 100644 --- a/pkg/providers/tf/upgrade.go +++ b/pkg/providers/tf/upgrade.go @@ -107,7 +107,7 @@ func (provider *TerraformProvider) performTerraformUpgrade(ctx context.Context, if currentTfVersion.LessThan(version.Must(version.NewVersion("1.5.0"))) { return errors.New("upgrade only supported for Terraform versions >= 1.5.0") } else if currentTfVersion.LessThan(provider.tfBinContext.DefaultTfVersion) { - if provider.tfBinContext.TfUpgradePath == nil || len(provider.tfBinContext.TfUpgradePath) == 0 { + if len(provider.tfBinContext.TfUpgradePath) == 0 { return errors.New("tofu version mismatch and no upgrade path specified") } for _, targetTfVersion := range provider.tfBinContext.TfUpgradePath {