v2.1.0
- Implement
func (c *Cache) CompareAndEvict(key, old interface{}) bool
. It becomes useful when there's an error while using a value and it needs to be evicted but meanwhile the cache may already hold a new value for key.CompareAndEvict
makes sure that with multiple concurrent evicters only the old value is evicted.