Skip to content

Commit

Permalink
Resolve linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SBGoods committed Jun 4, 2024
1 parent a6d3ecf commit 0ba4822
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
9 changes: 6 additions & 3 deletions internal/framework5provider/deferred_action_resource.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package framework

import (
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down
2 changes: 1 addition & 1 deletion internal/framework5provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
9 changes: 6 additions & 3 deletions internal/framework6provider/deferred_action_resource.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package framework

import (
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down
2 changes: 1 addition & 1 deletion internal/framework6provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit 0ba4822

Please sign in to comment.