fix(command): avoid duplicate GEOSEARCH args (#3955)

* fix(command): avoid duplicate GEOSEARCH args

* Address review comments.

---------

Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
This commit is contained in:
Mehmet TokgözandNedyalko Dyakov authored and GitHub committed 2026-08-24 17:09:11 +03:00
1 parent 911fad2994
commit 18837034a1
2 files changed
+10 -2

No files matched your search

+10 -1
View File
@@ -9445,7 +9445,16 @@ var _ = Describe("Commands", func() {
WithDist: true,
WithCoord: true,
}
val, err := client.GeoSearchLocation(ctx, "Sicily", q).Result()
cmd := client.GeoSearchLocation(ctx, "Sicily", q)
Expect(cmd.Args()).To(Equal([]interface{}{
"geosearch", "Sicily",
"fromlonlat", float64(15), float64(37),
"byradius", float64(200), "km",
"asc",
"withcoord", "withdist", "withhash",
}))
val, err := cmd.Result()
Expect(err).NotTo(HaveOccurred())
Expect(val).To(Equal([]redis.GeoLocation{
{
-1
View File
@@ -107,7 +107,6 @@ func (c cmdable) GeoSearchLocation(
) *GeoSearchLocationCmd {
args := make([]interface{}, 0, 16)
args = append(args, "geosearch", key)
args = geoSearchLocationArgs(q, args)
cmd := NewGeoSearchLocationCmd(ctx, q, args...)
_ = c(ctx, cmd)
return cmd