Skip to content

Commit dd3b8be

Browse files
committed
fixed store interface
1 parent b47ad0d commit dd3b8be

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

redis.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,11 @@ func (s *store) Delete(key string) string {
143143
return v
144144
}
145145

146-
func (s *store) Flush() {
146+
func (s *store) Flush() error {
147147
s.Lock()
148148
s.values = make(map[string]string)
149149
s.Unlock()
150+
return s.Save()
150151
}
151152

152153
func (s *store) Save() error {

redis_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ func TestStore(t *testing.T) {
6666
return
6767
}
6868

69-
store.Flush()
70-
err = store.Save()
69+
err = store.Flush()
7170
if err != nil {
7271
t.Error(err.Error())
7372
return

0 commit comments

Comments
 (0)