We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b47ad0d commit dd3b8beCopy full SHA for dd3b8be
redis.go
@@ -143,10 +143,11 @@ func (s *store) Delete(key string) string {
143
return v
144
}
145
146
-func (s *store) Flush() {
+func (s *store) Flush() error {
147
s.Lock()
148
s.values = make(map[string]string)
149
s.Unlock()
150
+ return s.Save()
151
152
153
func (s *store) Save() error {
redis_test.go
@@ -66,8 +66,7 @@ func TestStore(t *testing.T) {
66
return
67
68
69
- store.Flush()
70
- err = store.Save()
+ err = store.Flush()
71
if err != nil {
72
t.Error(err.Error())
73
0 commit comments