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

Request: Add formal interface for go-cache #116

Open augbog opened 4 years ago

augbog commented 4 years ago

Pardon me if there is a way to do this but I was wondering if it would be possible to support a formal interface for go-cache? For things like counterfeiter, it would be useful to have it so that it can crawl through and mock/stub all the methods in go-cache to create test doubles.

Right now this isn't possible though because no interface is available.

sylr commented 4 years ago

See https://github.com/patrickmn/go-cache/pull/92

FYI I merged it into github.com/sylr/go-cache/v2