Skip to content

Commit 2f31345

Browse files
committed
Uses ParseBoolAttr in common
1 parent 0555b7d commit 2f31345

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/generate/common/resource_identity.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ func ParseResourceIdentity(annotationName string, args Args, implementation Impl
153153
}
154154

155155
if attr, ok := args.Keyword["optional"]; ok {
156-
if b, err := strconv.ParseBool(attr); err != nil {
157-
return fmt.Errorf("invalid optional value: %q. Should be boolean value.", attr)
156+
if b, err := ParseBoolAttr("optional", attr); err != nil {
157+
return err
158158
} else {
159159
identityAttribute.Optional = b
160160
}
@@ -165,8 +165,8 @@ func ParseResourceIdentity(annotationName string, args Args, implementation Impl
165165
}
166166

167167
if attr, ok := args.Keyword["testNotNull"]; ok {
168-
if b, err := strconv.ParseBool(attr); err != nil {
169-
return fmt.Errorf("invalid optional value: %q. Should be boolean value.", attr)
168+
if b, err := ParseBoolAttr("testNotNull", attr); err != nil {
169+
return err
170170
} else {
171171
identityAttribute.TestNotNull = b
172172
}

0 commit comments

Comments
 (0)