From c3845a81ec8faa50ad6f66d021edd8d5286fc829 Mon Sep 17 00:00:00 2001 From: jgheewala Date: Wed, 18 Nov 2020 09:49:27 -0800 Subject: [PATCH] Entry RemoveReason is iota based with default value being 0 Currently all const for RemovedReason are explicitly set to avoid any breaking changes. For v3 migrating the reasons to iota makes code readability and managing addition of more reasons easier in the future. Test: Validated all test cases run successfully. --- bigcache.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bigcache.go b/bigcache.go index 37a793d7..0adefed4 100644 --- a/bigcache.go +++ b/bigcache.go @@ -34,12 +34,12 @@ type RemoveReason uint32 const ( _ RemoveReason = iota // Expired means the key is past its LifeWindow. - Expired = RemoveReason(1) + Expired // NoSpace means the key is the oldest and the cache size was at its maximum when Set was called, or the // entry exceeded the maximum shard size. - NoSpace = RemoveReason(2) + NoSpace // Deleted means Delete was called and this key was removed as a result. - Deleted = RemoveReason(3) + Deleted ) // NewBigCache initialize new instance of BigCache