mirror of
https://github.com/redis/go-redis.git
synced 2026-10-28 08:24:54 +08:00
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:
1 parent
911fad2994
commit
18837034a1
2 files changed
+10
-2
No files matched your search
+10
-1
@@ -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{
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user