From daade895aa47f71bd05859fc609e4e633660ed0f Mon Sep 17 00:00:00 2001 From: Geoff Garside Date: Tue, 9 Dec 2014 10:41:03 +0000 Subject: [PATCH] Add missing "BY" argument to Sort args list. Fixes "ERR syntax error" issue with Sort{By: "pattern"}. --- commands.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands.go b/commands.go index 1fc22aa..6068bab 100644 --- a/commands.go +++ b/commands.go @@ -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))