1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-11 04:20:40 +00:00

should use time.Since instead of time.Now().Sub

Signed-off-by: wgliang <liangcszzu@163.com>
This commit is contained in:
wangguoliang
2017-09-07 19:01:34 +08:00
parent d96289a81b
commit c8c25549e7
6 changed files with 7 additions and 7 deletions

2
cache/memory.go vendored
View File

@ -38,7 +38,7 @@ func (mi *MemoryItem) isExpire() bool {
if mi.lifespan == 0 {
return false
}
return time.Now().Sub(mi.createdTime) > mi.lifespan
return time.Since(mi.createdTime) > mi.lifespan
}
// MemoryCache is Memory cache adapter.