Skip to content

Commit

Permalink
chore: provide fmt.Stringer for EventType
Browse files Browse the repository at this point in the history
Simple fix to allow easier printing of events.

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira authored and talos-bot committed Mar 3, 2021
1 parent 8b3f192 commit 84c3c87
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 84c3c87

Please sign in to comment.