From 78090942692b2e08faa1c219b64c2e4e50a95481 Mon Sep 17 00:00:00 2001 From: Chris Marget Date: Fri, 30 Aug 2024 19:37:47 -0400 Subject: [PATCH] use type conversion to ensure large constants aren't used as `int` on 32-bit platforms --- apstra/resource_freeform_resource.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apstra/resource_freeform_resource.go b/apstra/resource_freeform_resource.go index 1fea4929..e161cfb5 100644 --- a/apstra/resource_freeform_resource.go +++ b/apstra/resource_freeform_resource.go @@ -71,7 +71,7 @@ func (o *resourceFreeformResource) ValidateConfig(ctx context.Context, req resou resp.Diagnostics.AddAttributeError( path.Root("integer_value"), errInvalidConfig, - fmt.Sprintf("When type is %s, value must be between %d and %d, got %s", config.Type, constants.AsnMin, constants.AsnMax, config.IntValue.String()), + fmt.Sprintf("When type is %s, value must be between %d and %d, got %s", config.Type, constants.AsnMin, uint32(constants.AsnMax), config.IntValue.String()), ) } case apstra.FFResourceTypeVni: @@ -116,7 +116,7 @@ func (o *resourceFreeformResource) ValidateConfig(ctx context.Context, req resou resp.Diagnostics.AddAttributeError( path.Root("integer_value"), errInvalidConfig, - fmt.Sprintf("When type is %s, value must be between %d and %d, got %s", config.Type, 1, math.MaxUint32, config.IntValue.String()), + fmt.Sprintf("When type is %s, value must be between %d and %d, got %s", config.Type, 1, uint32(math.MaxUint32), config.IntValue.String()), ) } case apstra.FFResourceTypeHostIpv4: