From 0ae7ea9463c3026f148c8ef94e66bdccf9abca39 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Wed, 3 Mar 2021 00:06:13 +0300 Subject: [PATCH] chore: provide fmt.Stringer for EventType Simple fix to allow easier printing of events. Signed-off-by: Andrey Smirnov --- pkg/state/state.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/state/state.go b/pkg/state/state.go index 76a2de6b..9b1ae771 100644 --- a/pkg/state/state.go +++ b/pkg/state/state.go @@ -24,6 +24,10 @@ const ( Destroyed ) +func (eventType EventType) String() string { + return [...]string{"Created", "Updated", "Destroyed"}[eventType] +} + // Event is emitted when resource changes. type Event struct { Type EventType