1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-31 05:04:23 +03:00

Refactor Set, SetNX and SetXX with expiration.

This commit is contained in:
Vladimir Mihailenco
2015-01-31 11:08:56 +02:00
parent d363cc72c5
commit 2dc61d458a
10 changed files with 182 additions and 89 deletions

View File

@ -32,7 +32,7 @@ var _ = Describe("Multi", func() {
get *redis.StringCmd
)
cmds, err := multi.Exec(func() error {
set = multi.Set("key", "hello")
set = multi.Set("key", "hello", 0)
get = multi.Get("key")
return nil
})
@ -53,9 +53,9 @@ var _ = Describe("Multi", func() {
}()
cmds, err := multi.Exec(func() error {
multi.Set("key1", "hello1")
multi.Set("key1", "hello1", 0)
multi.Discard()
multi.Set("key2", "hello2")
multi.Set("key2", "hello2", 0)
return nil
})
Expect(err).NotTo(HaveOccurred())