Skip to content

Commit 23c6554

Browse files
authored
fix #143 FILTER should not have white space from the EXCLUDE ( (#145)
1 parent 7a5af81 commit 23c6554

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

redisearch/query.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package redisearch
22

33
import (
4+
"fmt"
45
"math"
56

67
"github.com/gomodule/redigo/redis"
@@ -238,7 +239,7 @@ func appendNumArgs(num float64, exclude bool, args redis.Args) redis.Args {
238239
}
239240

240241
if exclude {
241-
return append(args, "(", num)
242+
return append(args, fmt.Sprint("(", num))
242243
}
243244
return append(args, num)
244245
}

redisearch/query_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func Test_appendNumArgs(t *testing.T) {
146146
want redis.Args
147147
}{
148148
{"1 arg", args{1.0, false, redis.Args{}}, redis.Args{1.0}},
149-
{"1 excluded arg", args{1.0, true, redis.Args{}}, redis.Args{"(", 1.0}},
149+
{"2.54 excluded arg", args{2.54, true, redis.Args{}}, redis.Args{"(2.54"}},
150150
{"+inf", args{math.Inf(1), false, redis.Args{}}, redis.Args{"+inf"}},
151151
{"+inf", args{math.Inf(-1), false, redis.Args{}}, redis.Args{"-inf"}},
152152
}

0 commit comments

Comments
 (0)