patrickmn / go-cache

An in-memory key:value store/cache (similar to Memcached) library for Go, suitable for single-machine applications.
https://patrickmn.com/projects/go-cache/
MIT License
8.16k stars 874 forks source link

Returns not found when key exists but is expired #99

Closed mhubbard closed 5 years ago

mhubbard commented 5 years ago

https://github.com/patrickmn/go-cache/blob/a3647f8e31d79543b2d0f0ae2fe5c379d72cedc0/cache.go#L131

Looks like you return nil, false when the key was actually found but has expired.

patrickmn commented 5 years ago

Expired items are treated as if they don't exist, so this is the intended behavior.