Skip to content

Commit 8254bc9

Browse files
jeanjean
authored andcommitted
fix: Apply gofmt formatting to resource_cloudstack_service_offering.go
- Fix code formatting to comply with Go standards - Align map fields and remove trailing whitespace - Required for CI/CD pipeline to pass
1 parent bf29adc commit 8254bc9

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

cloudstack/resource_cloudstack_service_offering.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -265,22 +265,22 @@ func resourceCloudStackServiceOfferingRead(d *schema.ResourceData, meta interfac
265265
d.SetId(s.Id)
266266

267267
fields := map[string]interface{}{
268-
"name": s.Name,
269-
"display_text": s.Displaytext,
270-
"cpu_number": s.Cpunumber,
271-
"cpu_speed": s.Cpuspeed,
272-
"host_tags": s.Hosttags,
273-
"limit_cpu_use": s.Limitcpuuse,
274-
"memory": s.Memory,
275-
"offer_ha": s.Offerha,
276-
"storage_type": s.Storagetype,
277-
"customized": s.Iscustomized,
278-
"min_cpu_number": getIntFromDetails(s.Serviceofferingdetails, "mincpunumber"),
279-
"max_cpu_number": getIntFromDetails(s.Serviceofferingdetails, "maxcpunumber"),
280-
"min_memory": getIntFromDetails(s.Serviceofferingdetails, "minmemory"),
281-
"max_memory": getIntFromDetails(s.Serviceofferingdetails, "maxmemory"),
282-
"encrypt_root": s.Encryptroot,
283-
"storage_tags": s.Storagetags,
268+
"name": s.Name,
269+
"display_text": s.Displaytext,
270+
"cpu_number": s.Cpunumber,
271+
"cpu_speed": s.Cpuspeed,
272+
"host_tags": s.Hosttags,
273+
"limit_cpu_use": s.Limitcpuuse,
274+
"memory": s.Memory,
275+
"offer_ha": s.Offerha,
276+
"storage_type": s.Storagetype,
277+
"customized": s.Iscustomized,
278+
"min_cpu_number": getIntFromDetails(s.Serviceofferingdetails, "mincpunumber"),
279+
"max_cpu_number": getIntFromDetails(s.Serviceofferingdetails, "maxcpunumber"),
280+
"min_memory": getIntFromDetails(s.Serviceofferingdetails, "minmemory"),
281+
"max_memory": getIntFromDetails(s.Serviceofferingdetails, "maxmemory"),
282+
"encrypt_root": s.Encryptroot,
283+
"storage_tags": s.Storagetags,
284284
"service_offering_details": getServiceOfferingDetails(s.Serviceofferingdetails),
285285
}
286286

@@ -400,27 +400,27 @@ func getIntFromDetails(details map[string]string, key string) interface{} {
400400
return nil
401401
}
402402

403-
// getServiceOfferingDetails extracts custom service offering details while excluding
403+
// getServiceOfferingDetails extracts custom service offering details while excluding
404404
// built-in details that are handled as separate schema fields
405405
func getServiceOfferingDetails(details map[string]string) map[string]interface{} {
406406
if details == nil {
407407
return make(map[string]interface{})
408408
}
409-
409+
410410
// List of built-in details that are handled as separate schema fields
411411
builtInKeys := map[string]bool{
412412
"mincpunumber": true,
413413
"maxcpunumber": true,
414414
"minmemory": true,
415415
"maxmemory": true,
416416
}
417-
417+
418418
result := make(map[string]interface{})
419419
for k, v := range details {
420420
if !builtInKeys[k] {
421421
result[k] = v
422422
}
423423
}
424-
424+
425425
return result
426426
}

0 commit comments

Comments
 (0)