Make common cache typed with generics (#2896)
Making typed common cache so that we don't use wrong types across set/get methods and more higher-level methods can be defined for cache. Currently, we are not able to operate over all keys of the cache due to generic types. I also removed code comments around the cache. Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Vendored
+1
-1
@@ -29,7 +29,7 @@ func checkErr(err error) {
|
||||
}
|
||||
|
||||
func TestCache(t *testing.T) {
|
||||
c := MakeCache(100*time.Millisecond, 100*time.Millisecond)
|
||||
c := MakeCache[string, string](100*time.Millisecond, 100*time.Millisecond)
|
||||
|
||||
_, err := c.Set("a", "b")
|
||||
checkErr(err)
|
||||
|
||||
Reference in New Issue
Block a user