Skip to content

Commit

Permalink
Add action forget (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-hontarau authored Jun 24, 2024
1 parent 7d39b02 commit bb8c49e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions action.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const (

// ActionDelete denotes a delete operation.
ActionDelete Action = "delete"

// ActionForget denotes a forget operation.
ActionForget Action = "forget"
)

// Actions denotes a valid change type.
Expand Down Expand Up @@ -105,3 +108,12 @@ func (a Actions) CreateBeforeDestroy() bool {
func (a Actions) Replace() bool {
return a.DestroyBeforeCreate() || a.CreateBeforeDestroy()
}

// Forget is true if this set of Actions denotes a forget operation.
func (a Actions) Forget() bool {
if len(a) != 1 {
return false
}

return a[0] == ActionForget
}

0 comments on commit bb8c49e

Please sign in to comment.