Skip to content

Commit d9ecf28

Browse files
remvoe redundant pf writeonly interface
1 parent 4abc06e commit d9ecf28

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

pkg/pf/internal/pfutils/attr.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,13 @@ type AttrLike interface {
4545
IsOptional() bool
4646
IsRequired() bool
4747
IsSensitive() bool
48+
IsWriteOnly() bool
4849
GetDeprecationMessage() string
4950
GetDescription() string
5051
GetMarkdownDescription() string
5152
GetType() attr.Type
5253
}
5354

54-
type AttrLikeWithWriteOnly interface {
55-
AttrLike
56-
IsWriteOnly() bool
57-
}
58-
5955
func FromProviderAttribute(x pschema.Attribute) Attr {
6056
return FromAttrLike(x)
6157
}

pkg/pf/internal/schemashim/attr_schema.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,7 @@ func (s *attrSchema) Sensitive() bool {
142142
}
143143

144144
func (s *attrSchema) WriteOnly() bool {
145-
schema, ok := s.attr.(pfutils.AttrLikeWithWriteOnly)
146-
if ok {
147-
return schema.IsWriteOnly()
148-
}
149-
return false
145+
return s.attr.IsWriteOnly()
150146
}
151147

152148
func (*attrSchema) SetElement(config interface{}) (interface{}, error) {

0 commit comments

Comments
 (0)