Browse Source

设置KEY增加过期时间

master
guzeng 3 years ago
parent
commit
de10517b1f
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      string.go

+ 4
- 4
string.go View File

@ -35,7 +35,7 @@ func Set(key, value string, ttl string, url ...string) (string, error) {
conn, _, err := Conn(url...)
if err != nil {
return 0, err
return "", err
}
defer conn.Close()
@ -46,7 +46,7 @@ func Set(key, value string, ttl string, url ...string) (string, error) {
err = conn.Set(req, res)
if err != nil {
return 0, err
return "", err
}
return res.GetRet(), nil
@ -58,7 +58,7 @@ func Del(key string, url ...string) (string, error) {
conn, _, err := Conn(url...)
if err != nil {
return 0, err
return "", err
}
defer conn.Close()
@ -69,7 +69,7 @@ func Del(key string, url ...string) (string, error) {
err = conn.Del(req, res)
if err != nil {
return 0, err
return "", err
}
return res.GetRet(), nil


Loading…
Cancel
Save