коммит произвёл
enahum
родитель
25d40bc98c
Коммит
56dc863de1
@@ -68,7 +68,7 @@ func (c *Cache) Add(key, value interface{}) bool {
|
||||
return c.AddWithExpiresInSecs(key, value, 0)
|
||||
}
|
||||
|
||||
// Add adds a value to the cache. Returns true if an eviction occured.
|
||||
// Add adds a value to the cache. Returns true if an eviction occurred.
|
||||
func (c *Cache) AddWithExpiresInSecs(key, value interface{}, expireAtSecs int64) bool {
|
||||
c.lock.Lock()
|
||||
defer c.lock.Unlock()
|
||||
|
||||
@@ -73,7 +73,7 @@ func TestLRU(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// test that Add return true/false if an eviction occured
|
||||
// test that Add return true/false if an eviction occurred
|
||||
func TestLRUAdd(t *testing.T) {
|
||||
evictCounter := 0
|
||||
onEvicted := func(k interface{}, v interface{}) {
|
||||
|
||||
Ссылка в новой задаче
Block a user