Skip to content

Commit d3f767a

Browse files
committed
fix lint
1 parent 54fac7c commit d3f767a

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

internal/services/webhosting/offer_data_source.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ func dataSourceOfferRead(ctx context.Context, d *schema.ResourceData, m interfac
199199
cp, _ := d.Get("control_panel").(string)
200200
if offer.ID == d.Get("offer_id") || (offer.Name == d.Get("name") && (cp == "" || strings.EqualFold(offer.ControlPanelName, cp))) {
201201
filteredOffer = offer
202+
202203
break
203204
}
204205
}

internal/services/webhosting/types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ func flattenOffer(offer *webhosting.Offer) interface{} {
1010
if offer == nil {
1111
return []interface{}{}
1212
}
13+
1314
return []map[string]interface{}{
1415
{
1516
"id": offer.ID,
@@ -29,7 +30,9 @@ func flattenOfferOptions(options []*webhosting.OfferOption) interface{} {
2930
if options == nil {
3031
return []interface{}{}
3132
}
33+
3234
res := make([]map[string]interface{}, 0, len(options))
35+
3336
for _, option := range options {
3437
res = append(res, map[string]interface{}{
3538
"id": option.ID,
@@ -42,6 +45,7 @@ func flattenOfferOptions(options []*webhosting.OfferOption) interface{} {
4245
"price": flattenOfferPrice(option.Price),
4346
})
4447
}
48+
4549
return res
4650
}
4751

@@ -76,15 +80,19 @@ func flattenHostingOptions(options []*webhosting.OfferOption) []map[string]inter
7680

7781
func expandOfferOptions(data interface{}) []*webhosting.OfferOptionRequest {
7882
optionIDs := types.ExpandStrings(data)
83+
7984
offerOptions := make([]*webhosting.OfferOptionRequest, 0, len(optionIDs))
85+
8086
for _, id := range optionIDs {
8187
if id == "" {
8288
continue
8389
}
90+
8491
offerOptions = append(offerOptions, &webhosting.OfferOptionRequest{
8592
ID: id,
8693
Quantity: 1,
8794
})
8895
}
96+
8997
return offerOptions
9098
}

internal/services/webhosting/webhosting.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ func ResourceWebhosting() *schema.Resource {
144144
"organization_id": func() *schema.Schema {
145145
s := account.OrganizationIDSchema()
146146
s.Deprecated = "The organization_id field is deprecated and will be removed in the next major version."
147+
147148
return s
148149
}(),
149150
},
@@ -159,6 +160,7 @@ func ResourceWebhosting() *schema.Resource {
159160
}
160161
}
161162
}
163+
162164
return nil
163165
},
164166
}
@@ -219,8 +221,10 @@ func resourceWebhostingRead(ctx context.Context, d *schema.ResourceData, m inter
219221
if err != nil {
220222
if httperrors.Is404(err) {
221223
d.SetId("")
224+
222225
return nil
223226
}
227+
224228
return diag.FromErr(err)
225229
}
226230

@@ -234,7 +238,7 @@ func resourceWebhostingRead(ctx context.Context, d *schema.ResourceData, m inter
234238
_ = d.Set("platform_number", webhostingResponse.Platform.Number)
235239
_ = d.Set("options", flattenHostingOptions(webhostingResponse.Offer.Options))
236240
_ = d.Set("offer_name", webhostingResponse.Offer.Name)
237-
_ = d.Set("dns_status", webhostingResponse.DNSStatus.String())
241+
_ = d.Set("dns_status", webhostingResponse.DNSStatus.String()) // nolint:staticcheck
238242
_ = d.Set("cpanel_urls", flattenHostingCpanelUrls(webhostingResponse.Platform.ControlPanel.URLs))
239243
_ = d.Set("username", webhostingResponse.User.Username)
240244
_ = d.Set("region", string(region))
@@ -269,9 +273,11 @@ func resourceWebhostingUpdate(ctx context.Context, d *schema.ResourceData, m int
269273

270274
if d.HasChange("offer_id") {
271275
_, offerID, err := regional.ParseID(d.Get("offer_id").(string))
276+
272277
if err != nil {
273278
return diag.FromErr(err)
274279
}
280+
275281
updateRequest.OfferID = types.ExpandUpdatedStringPtr(offerID)
276282
hasChanged = true
277283
}

0 commit comments

Comments
 (0)