From 1a6a14e30121d090ed9aa2ae85d79a329d3ca898 Mon Sep 17 00:00:00 2001 From: maypok86 Date: Sun, 28 Jul 2024 18:55:48 +0300 Subject: [PATCH] [#100] Implement the fmt.Stringer interface for the DeletionReason type --- internal/core/cache.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/internal/core/cache.go b/internal/core/cache.go index 75f7874..f02e1c0 100644 --- a/internal/core/cache.go +++ b/internal/core/cache.go @@ -44,6 +44,21 @@ const ( Expired ) +func (dc DeletionCause) String() string { + switch dc { + case Explicit: + return "Explicit" + case Replaced: + return "Replaced" + case Size: + return "Size" + case Expired: + return "Expired" + default: + panic("unknown deletion cause") + } +} + const ( minWriteBufferCapacity uint32 = 4 )