Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion command.go
Original file line number Diff line number Diff line change
Expand Up @@ -5084,7 +5084,7 @@ func NewGeoSearchLocationCmd(
return &GeoSearchLocationCmd{
baseCmd: baseCmd{
ctx: ctx,
args: geoSearchLocationArgs(opt, args),
args: args,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore query expansion in the public constructor

This leaves the exported constructor no longer expanding GeoSearchLocationQuery into the GEOSEARCH arguments. Code that constructs this command directly, such as NewGeoSearchLocationCmd(ctx, q, "geosearch", key) for Client.Process, now sends only the supplied prefix and omits the FROM*/BY*/WITH* options, so Redis returns a syntax or arity error even though the same call worked before; the duplicate-args fix can be applied in the cmdable wrapper without changing the constructor's public behavior.

Useful? React with 👍 / 👎.

cmdType: CmdTypeGeoSearchLocation,
},
opt: opt,
Expand Down
11 changes: 10 additions & 1 deletion commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9411,7 +9411,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{
{
Expand Down
Loading