Copilot commented on code in PR #330:
URL:
https://github.com/apache/cloudstack-terraform-provider/pull/330#discussion_r3879651185
##########
cloudstack/resource_cloudstack_vpc_offering.go:
##########
@@ -22,6 +22,7 @@ package cloudstack
import (
"fmt"
"log"
+ "strings"
Review Comment:
This duplicates a common Terraform helper. Consider replacing both inline
`DiffSuppressFunc` closures with `schema.SuppressCaseDiff` (which already
implements `strings.EqualFold`). That removes duplication and should allow
dropping the direct `strings` import here.
##########
cloudstack/resource_cloudstack_vpc_offering.go:
##########
@@ -96,6 +100,9 @@ func resourceCloudStackVPCOffering() *schema.Resource {
Computed: true,
Description: "the routing mode for the VPC
offering. Supported types are: Static or Dynamic.",
ForceNew: true,
+ DiffSuppressFunc: func(k, old, new string, d
*schema.ResourceData) bool {
+ return strings.EqualFold(old, new)
+ },
Review Comment:
This duplicates a common Terraform helper. Consider replacing both inline
`DiffSuppressFunc` closures with `schema.SuppressCaseDiff` (which already
implements `strings.EqualFold`). That removes duplication and should allow
dropping the direct `strings` import here.
##########
cloudstack/resource_cloudstack_vpc_offering.go:
##########
@@ -82,6 +83,9 @@ func resourceCloudStackVPCOffering() *schema.Resource {
Computed: true,
Description: "The internet protocol of the VPC
offering. Options are ipv4 and dualstack. Default is ipv4. dualstack will
create a VPC offering that supports both IPv4 and IPv6",
ForceNew: true,
+ DiffSuppressFunc: func(k, old, new string, d
*schema.ResourceData) bool {
+ return strings.EqualFold(old, new)
+ },
Review Comment:
This duplicates a common Terraform helper. Consider replacing both inline
`DiffSuppressFunc` closures with `schema.SuppressCaseDiff` (which already
implements `strings.EqualFold`). That removes duplication and should allow
dropping the direct `strings` import here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]