From 1b715bcbeaa18f773a2ac457fe2e6e2b5612979d Mon Sep 17 00:00:00 2001 From: astaxie Date: Tue, 26 Mar 2013 22:31:54 +0800 Subject: [PATCH] fix cache bug --- cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache.go b/cache.go index c03ad327..88da038d 100644 --- a/cache.go +++ b/cache.go @@ -51,7 +51,7 @@ func (bc *BeeCache) Put(name string, value interface{}, expired int) error { bc.lock.Lock() defer bc.lock.Unlock() t := BeeItem{val: value, Lastaccess: time.Now(), expired: expired} - if _, ok := bc.items[name]; !ok { + if _, ok := bc.items[name]; ok { return errors.New("the key is exist") } else { bc.items[name] = &t