@@ -15,7 +15,7 @@ import (
1515type intBetweenValidator struct {
1616 tfsdk.AttributeValidator
1717
18- min , max int
18+ min , max int64
1919}
2020
2121// Description describes the validation in plain text formatting.
@@ -35,7 +35,7 @@ func (validator intBetweenValidator) Validate(ctx context.Context, request tfsdk
3535 return
3636 }
3737
38- if i < int64 ( validator .min ) || i > int64 ( validator .max ) {
38+ if i < validator .min || i > validator .max {
3939 response .Diagnostics .Append (ccdiag .NewInvalidValueAttributeError (
4040 request .AttributePath ,
4141 fmt .Sprintf ("expected value to be in the range [%d, %d], got %d" , validator .min , validator .max , i ),
@@ -46,7 +46,7 @@ func (validator intBetweenValidator) Validate(ctx context.Context, request tfsdk
4646}
4747
4848// IntBetween returns a new integer value between validator.
49- func IntBetween (min , max int ) tfsdk.AttributeValidator {
49+ func IntBetween (min , max int64 ) tfsdk.AttributeValidator {
5050 if min > max {
5151 return nil
5252 }
@@ -61,7 +61,7 @@ func IntBetween(min, max int) tfsdk.AttributeValidator {
6161type intAtLeastValidator struct {
6262 tfsdk.AttributeValidator
6363
64- min int
64+ min int64
6565}
6666
6767// Description describes the validation in plain text formatting.
@@ -81,7 +81,7 @@ func (validator intAtLeastValidator) Validate(ctx context.Context, request tfsdk
8181 return
8282 }
8383
84- if i < int64 ( validator .min ) {
84+ if i < validator .min {
8585 response .Diagnostics .Append (ccdiag .NewInvalidValueAttributeError (
8686 request .AttributePath ,
8787 fmt .Sprintf ("expected value to be at least %d, got %d" , validator .min , i ),
@@ -92,7 +92,7 @@ func (validator intAtLeastValidator) Validate(ctx context.Context, request tfsdk
9292}
9393
9494// IntAtLeast returns a new integer value at least validator.
95- func IntAtLeast (min int ) tfsdk.AttributeValidator {
95+ func IntAtLeast (min int64 ) tfsdk.AttributeValidator {
9696 return intAtLeastValidator {
9797 min : min ,
9898 }
@@ -102,7 +102,7 @@ func IntAtLeast(min int) tfsdk.AttributeValidator {
102102type intAtMostValidator struct {
103103 tfsdk.AttributeValidator
104104
105- max int
105+ max int64
106106}
107107
108108// Description describes the validation in plain text formatting.
@@ -122,7 +122,7 @@ func (validator intAtMostValidator) Validate(ctx context.Context, request tfsdk.
122122 return
123123 }
124124
125- if i > int64 ( validator .max ) {
125+ if i > validator .max {
126126 response .Diagnostics .Append (ccdiag .NewInvalidValueAttributeError (
127127 request .AttributePath ,
128128 fmt .Sprintf ("expected value to be at most %d, got %d" , validator .max , i ),
@@ -133,7 +133,7 @@ func (validator intAtMostValidator) Validate(ctx context.Context, request tfsdk.
133133}
134134
135135// IntAtMost returns a new integer value at most validator.
136- func IntAtMost (max int ) tfsdk.AttributeValidator {
136+ func IntAtMost (max int64 ) tfsdk.AttributeValidator {
137137 return intAtMostValidator {
138138 max : max ,
139139 }
0 commit comments