Add missing "BY" argument to Sort args list.

Fixes "ERR syntax error" issue with Sort{By: "pattern"}.
This commit is contained in:
Geoff Garside 2014-12-09 10:41:03 +00:00
parent c9c1f18a58
commit daade895aa
1 changed files with 1 additions and 1 deletions

View File

@ -196,7 +196,7 @@ type Sort struct {
func (c *Client) Sort(key string, sort Sort) *StringSliceCmd {
args := []string{"SORT", key}
if sort.By != "" {
args = append(args, sort.By)
args = append(args, "BY", sort.By)
}
if sort.Offset != 0 || sort.Count != 0 {
args = append(args, "LIMIT", formatFloat(sort.Offset), formatFloat(sort.Count))