New Functions For the Caching Module

The Following New Functions have been added
    1. AddToCache Adds to the CACHE_LIST map
    2. GetFromCache Retrieves path from CACHE_LIST map
    3. Rename WriteToCache -> WriteCache()
    4. GenerateName now replaces spaces with underscores.
This commit is contained in:
aditya-K2
2021-11-20 20:21:54 +05:30
parent 51b63a19e5
commit 42832491d0
2 changed files with 19 additions and 5 deletions

2
cache/cache_test.go vendored
View File

@@ -4,7 +4,7 @@ import "testing"
func TestLoadCache(t *testing.T) {
expectedResult := [2]string{"hello/wer.jpg", "hello/iwer.jpg"}
loadCache("./testdata/cache.txt")
LoadCache("./testdata/cache.txt")
var i int = 0
for _, v := range CACHE_LIST {
if v != expectedResult[i] {