Skip to content

Commit

Permalink
chore: omit redundant nil check on slice when checking its length
Browse files Browse the repository at this point in the history
  • Loading branch information
zucchinidev committed Aug 21, 2024
1 parent 502372a commit fa43cde
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/providers/tf/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit fa43cde

Please sign in to comment.