@@ -2,7 +2,6 @@ package defaults
22
33import (
44 "context"
5- "fmt"
65 "os"
76
87 "github.com/hashicorp/terraform-plugin-framework/resource/schema/defaults"
@@ -31,11 +30,11 @@ type envDefaultValue[T defaultable] struct {
3130}
3231
3332func (d envDefaultValue [_ ]) Description (_ context.Context ) string {
34- return fmt . Sprintf ( "If value is not configured, defaults to a representation of the provided env variable" )
33+ return "If value is not configured, defaults to a representation of the provided env variable"
3534}
3635
3736func (d envDefaultValue [_ ]) MarkdownDescription (_ context.Context ) string {
38- return fmt . Sprintf ( "If value is not configured, defaults to a representation of the provided env variable" )
37+ return "If value is not configured, defaults to a representation of the provided env variable"
3938}
4039
4140func (d envDefaultValue [T ]) DefaultString (_ context.Context , _ defaults.StringRequest , resp * defaults.StringResponse ) {
@@ -44,7 +43,8 @@ func (d envDefaultValue[T]) DefaultString(_ context.Context, _ defaults.StringRe
4443 value = v
4544 }
4645
47- resp .PlanValue = types .StringValue (value .(string ))
46+ stringValue , _ := value .(string )
47+ resp .PlanValue = types .StringValue (stringValue )
4848}
4949
5050func (d envDefaultValue [T ]) DefaultBool (_ context.Context , _ defaults.BoolRequest , resp * defaults.BoolResponse ) {
@@ -53,5 +53,6 @@ func (d envDefaultValue[T]) DefaultBool(_ context.Context, _ defaults.BoolReques
5353 value = v == "true"
5454 }
5555
56- resp .PlanValue = types .BoolValue (value .(bool ))
56+ boolValue , _ := value .(bool )
57+ resp .PlanValue = types .BoolValue (boolValue )
5758}
0 commit comments