Skip to content

Commit bb8c49e

Browse files
Add action forget (#126)
1 parent 7d39b02 commit bb8c49e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

action.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ const (
2626

2727
// ActionDelete denotes a delete operation.
2828
ActionDelete Action = "delete"
29+
30+
// ActionForget denotes a forget operation.
31+
ActionForget Action = "forget"
2932
)
3033

3134
// Actions denotes a valid change type.
@@ -105,3 +108,12 @@ func (a Actions) CreateBeforeDestroy() bool {
105108
func (a Actions) Replace() bool {
106109
return a.DestroyBeforeCreate() || a.CreateBeforeDestroy()
107110
}
111+
112+
// Forget is true if this set of Actions denotes a forget operation.
113+
func (a Actions) Forget() bool {
114+
if len(a) != 1 {
115+
return false
116+
}
117+
118+
return a[0] == ActionForget
119+
}

0 commit comments

Comments
 (0)