From a8841c34a6cf2e3d5500b8ba28e6ca432417244c Mon Sep 17 00:00:00 2001 From: ilya-hontarau Date: Fri, 10 May 2024 17:40:50 +0200 Subject: [PATCH] Add action forget --- action.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/action.go b/action.go index c74f7e6..9dcab85 100644 --- a/action.go +++ b/action.go @@ -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. @@ -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 +}