Skip to content

Commit d5c511c

Browse files
author
XieBiao
committed
fix error
1 parent 730c2f2 commit d5c511c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

storages/redis.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package storages
22

33
import (
4-
"github.com/garyburd/redigo/redis"
5-
"fmt"
64
"bytes"
7-
"strings"
5+
"fmt"
6+
"github.com/garyburd/redigo/redis"
87
"strconv"
8+
"strings"
99
)
1010

1111
type RedisClient struct {
@@ -89,14 +89,16 @@ func (client RedisClient) SerializedLength(key string) (uint64, error) {
8989
reply, err := client.conn.Do("DEBUG", "OBJECT", key)
9090
debug, err := redis.String(reply, err)
9191

92-
debugs := strings.Split(debug, " ")
93-
items := strings.Split(debugs[4], ":")
9492
if err != nil {
9593
return 0, err
9694
}
95+
96+
debugs := strings.Split(debug, " ")
97+
items := strings.Split(debugs[4], ":")
98+
9799
return strconv.ParseUint(items[1], 10, 64)
98100
}
99101

100-
func (client RedisClient) Close() (error) {
102+
func (client RedisClient) Close() error {
101103
return client.conn.Close()
102104
}

0 commit comments

Comments
 (0)