From 0ba4822c721c08aab71b8a0a3e1d96ebf19c0449 Mon Sep 17 00:00:00 2001 From: Selena Goods Date: Tue, 4 Jun 2024 17:46:29 -0400 Subject: [PATCH] Resolve linting errors --- internal/framework5provider/deferred_action_resource.go | 9 ++++++--- internal/framework5provider/provider.go | 2 +- internal/framework6provider/deferred_action_resource.go | 9 ++++++--- internal/framework6provider/provider.go | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/internal/framework5provider/deferred_action_resource.go b/internal/framework5provider/deferred_action_resource.go index b789510..d011767 100644 --- a/internal/framework5provider/deferred_action_resource.go +++ b/internal/framework5provider/deferred_action_resource.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package framework import ( @@ -48,7 +51,7 @@ func (r *DeferredActionResource) ModifyPlan(ctx context.Context, req resource.Mo return } - if plan != nil && plan.ModifyPlanDeferral.ValueBool() == true && req.ClientCapabilities.DeferralAllowed == true { + if plan != nil && plan.ModifyPlanDeferral.ValueBool() && req.ClientCapabilities.DeferralAllowed { resp.Deferred = &resource.Deferred{ Reason: resource.DeferredReasonResourceConfigUnknown, } @@ -95,7 +98,7 @@ func (r *DeferredActionResource) Read(ctx context.Context, req resource.ReadRequ return } - if data.ReadDeferral.ValueBool() == true && req.ClientCapabilities.DeferralAllowed == true { + if data.ReadDeferral.ValueBool() && req.ClientCapabilities.DeferralAllowed { resp.Deferred = &resource.Deferred{ Reason: resource.DeferredReasonResourceConfigUnknown, } @@ -127,7 +130,7 @@ type DeferredActionResourceModel struct { } func (r *DeferredActionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { - if req.ClientCapabilities.DeferralAllowed == true { + if req.ClientCapabilities.DeferralAllowed { resp.Deferred = &resource.Deferred{ Reason: resource.DeferredReasonResourceConfigUnknown, } diff --git a/internal/framework5provider/provider.go b/internal/framework5provider/provider.go index ce8c6c2..eaf12c4 100644 --- a/internal/framework5provider/provider.go +++ b/internal/framework5provider/provider.go @@ -55,7 +55,7 @@ func (p *testProvider) Configure(ctx context.Context, req provider.ConfigureRequ if err != nil { resp.Diagnostics.AddError("Error initialising client", err.Error()) } - if req.ClientCapabilities.DeferralAllowed == true && config.Deferral.ValueBool() == true { + if req.ClientCapabilities.DeferralAllowed && config.Deferral.ValueBool() { resp.Deferred = &provider.Deferred{ Reason: provider.DeferredReasonProviderConfigUnknown, } diff --git a/internal/framework6provider/deferred_action_resource.go b/internal/framework6provider/deferred_action_resource.go index b789510..d011767 100644 --- a/internal/framework6provider/deferred_action_resource.go +++ b/internal/framework6provider/deferred_action_resource.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package framework import ( @@ -48,7 +51,7 @@ func (r *DeferredActionResource) ModifyPlan(ctx context.Context, req resource.Mo return } - if plan != nil && plan.ModifyPlanDeferral.ValueBool() == true && req.ClientCapabilities.DeferralAllowed == true { + if plan != nil && plan.ModifyPlanDeferral.ValueBool() && req.ClientCapabilities.DeferralAllowed { resp.Deferred = &resource.Deferred{ Reason: resource.DeferredReasonResourceConfigUnknown, } @@ -95,7 +98,7 @@ func (r *DeferredActionResource) Read(ctx context.Context, req resource.ReadRequ return } - if data.ReadDeferral.ValueBool() == true && req.ClientCapabilities.DeferralAllowed == true { + if data.ReadDeferral.ValueBool() && req.ClientCapabilities.DeferralAllowed { resp.Deferred = &resource.Deferred{ Reason: resource.DeferredReasonResourceConfigUnknown, } @@ -127,7 +130,7 @@ type DeferredActionResourceModel struct { } func (r *DeferredActionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { - if req.ClientCapabilities.DeferralAllowed == true { + if req.ClientCapabilities.DeferralAllowed { resp.Deferred = &resource.Deferred{ Reason: resource.DeferredReasonResourceConfigUnknown, } diff --git a/internal/framework6provider/provider.go b/internal/framework6provider/provider.go index cfa87d2..5cc9423 100644 --- a/internal/framework6provider/provider.go +++ b/internal/framework6provider/provider.go @@ -55,7 +55,7 @@ func (p *testProvider) Configure(ctx context.Context, req provider.ConfigureRequ if err != nil { resp.Diagnostics.AddError("Error initialising client", err.Error()) } - if req.ClientCapabilities.DeferralAllowed == true && config.Deferral.ValueBool() == true { + if req.ClientCapabilities.DeferralAllowed && config.Deferral.ValueBool() { resp.Deferred = &provider.Deferred{ Reason: provider.DeferredReasonProviderConfigUnknown, }