Open butaca opened 11 months ago
This seems like a trivial fix, just need to handle bigcache.ErrEntryNotFound
in Get
method. However, many existing library usages may be dependent on current behavior which returns error directly. So fixing this may cause issues for some users.
I'm trying to check if a key exists in the cache. Since there is not a CacheInterface.Exists, I have to rely on CacheInterface.Get to perform the check. The Redis implementation correctly returns *store.NotFound when the key is not found, but the BigCache one does not.
Steps for Reproduction
Expected behavior:
Returned error is of type *store.NotFound
Actual behavior:
Returned error is of not of type *store.NotFound
Platforms:
macOS and dockerized Linux from scratch
Versions:
gocache v4.1.3 and v4.1.4 go 1.21 BigCache store v4.1.2 and v4.2.0 BigCache v3.1.0 Redis store v4.2.0 Redis client v9.0.5 Redis server 7.0.12