Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ikegentz committed Dec 24, 2023
1 parent f31303e commit a4848d1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions internal/provider/deployment_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package provider
import (
"context"
"fmt"
"net/http"

"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
Expand All @@ -18,7 +17,6 @@ func NewDeploymentDataSource() datasource.DataSource {
}

type DeploymentDataSource struct {
client *http.Client
token string
organizationId string
}
Expand Down Expand Up @@ -112,7 +110,7 @@ func (d *DeploymentDataSource) Read(ctx context.Context, req datasource.ReadRequ
decoded, err := api.GetDeployment(d.token, d.organizationId, data.Id.ValueString())

if err != nil {
resp.Diagnostics.AddError("Client Error", fmt.Sprintf(err.Error()))
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("ERROR: %s", err.Error()))
return
}

Expand Down
4 changes: 1 addition & 3 deletions internal/provider/deployment_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"log"
"net/http"
"strings"
"time"

Expand All @@ -25,7 +24,6 @@ func NewDeploymentResource() resource.Resource {
}

type DeploymentResource struct {
client *http.Client
token string
organizationId string
}
Expand Down Expand Up @@ -240,7 +238,7 @@ func (r *DeploymentResource) Create(ctx context.Context, req resource.CreateRequ
}

for deployResponse.Status != api.DeploymentStatusHealthy {
deployResponse, err = api.GetDeployment(r.token, r.organizationId, deployResponse.Id)
deployResponse, _ = api.GetDeployment(r.token, r.organizationId, deployResponse.Id)
time.Sleep(1 * time.Second)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/provider/workspace_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (d *WorkspaceDataSource) Read(ctx context.Context, req datasource.ReadReque
decoded, err := api.GetWorkspace(d.token, d.organizationId, data.Id.ValueString())

if err != nil {
resp.Diagnostics.AddError("Client Error", fmt.Sprintf(err.Error()))
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("ERROR: %s", err.Error()))
return
}

Expand Down
2 changes: 1 addition & 1 deletion internal/provider/workspace_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (r *WorkspaceResource) Read(ctx context.Context, req resource.ReadRequest,
decoded, err := api.GetWorkspace(r.token, r.organizationId, data.Id.ValueString())

if err != nil {
resp.Diagnostics.AddError("Client Error", fmt.Sprintf(err.Error()))
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("ERROR: %s", err.Error()))
return
}

Expand Down

0 comments on commit a4848d1

Please sign in to comment.