Skip to content

Commit

Permalink
refactor: cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
henryde committed May 21, 2024
1 parent 4846066 commit dc54332
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 5 additions & 5 deletions internal/provider/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func (c *MeshStackProviderClient) ReadBuildingBlock(uuid string) (*MeshBuildingB
}

if res.StatusCode != 200 {
return nil, errors.New(fmt.Sprintf("unexpected status code: %d, %s", res.StatusCode, data))
return nil, fmt.Errorf("unexpected status code: %d, %s", res.StatusCode, data)
}

var bb MeshBuildingBlock
Expand Down Expand Up @@ -246,7 +246,7 @@ func (c *MeshStackProviderClient) ReadProject(workspace string, name string) (*M
}

if res.StatusCode != 200 {
return nil, errors.New(fmt.Sprintf("unexpected status code: %d, %s", res.StatusCode, data))
return nil, fmt.Errorf("unexpected status code: %d, %s", res.StatusCode, data)
}

var project MeshProject
Expand Down Expand Up @@ -283,7 +283,7 @@ func (c *MeshStackProviderClient) CreateProject(project *MeshProjectCreate) (*Me
}

if res.StatusCode != 201 {
return nil, errors.New(fmt.Sprintf("unexpected status code: %d, %s", res.StatusCode, data))
return nil, fmt.Errorf("unexpected status code: %d, %s", res.StatusCode, data)
}

var createdProject MeshProject
Expand Down Expand Up @@ -323,7 +323,7 @@ func (c *MeshStackProviderClient) UpdateProject(project *MeshProjectCreate) (*Me
}

if res.StatusCode != 200 {
return nil, errors.New(fmt.Sprintf("unexpected status code: %d, %s", res.StatusCode, data))
return nil, fmt.Errorf("unexpected status code: %d, %s", res.StatusCode, data)
}

var updatedProject MeshProject
Expand Down Expand Up @@ -357,7 +357,7 @@ func (c *MeshStackProviderClient) DeleteProject(workspace string, name string) e
}

if res.StatusCode != 202 {
return errors.New(fmt.Sprintf("unexpected status code: %d, %s", res.StatusCode, data))
return fmt.Errorf("unexpected status code: %d, %s", res.StatusCode, data)
}

return nil
Expand Down
1 change: 0 additions & 1 deletion internal/provider/project_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ func (r *projectResource) Read(ctx context.Context, req resource.ReadRequest, re

// client data maps directly to the schema so we just need to set the state
resp.Diagnostics.Append(resp.State.Set(ctx, project)...)
return
}

// Update updates the resource and sets the updated Terraform state on success.
Expand Down

0 comments on commit dc54332

Please sign in to comment.