From 7564c8083953c4a23248d1b2a9c7c51a38b6a316 Mon Sep 17 00:00:00 2001 From: jbrinkman Date: Mon, 6 Jan 2025 09:44:08 -0500 Subject: [PATCH] apply code review formatting feedback Signed-off-by: jbrinkman --- go/api/response_handlers.go | 3 +-- go/api/response_types.go | 7 +++++-- go/integTest/shared_commands_test.go | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/go/api/response_handlers.go b/go/api/response_handlers.go index 892ace82a9..4a5056c0c6 100644 --- a/go/api/response_handlers.go +++ b/go/api/response_handlers.go @@ -418,8 +418,7 @@ func handleKeyWithMemberAndScoreResponse(response *C.struct_CommandResponse) (Re key := arr[0].(string) member := arr[1].(string) score := arr[2].(float64) - kms := KeyWithMemberAndScore{key, member, score} - return CreateKeyWithMemberAndScoreResult(KeyWithMemberAndScore{arr[0].(string), arr[1].(string), arr[2].(float64)}), nil + return CreateKeyWithMemberAndScoreResult(KeyWithMemberAndScore{key, member, score}), nil } func handleScanResponse( diff --git a/go/api/response_types.go b/go/api/response_types.go index 3338f51c05..6172c4ff2b 100644 --- a/go/api/response_types.go +++ b/go/api/response_types.go @@ -7,9 +7,12 @@ type Result[T any] struct { isNil bool } +// KeyWithMemberAndScore is used by BZPOPMIN/BZPOPMAX, which return an object consisting of the key of the sorted set that was +// popped, the popped member, and its score. type KeyWithMemberAndScore struct { - Key, Member string - Score float64 + Key string + Member string + Score float64 } func (result Result[T]) IsNil() bool { diff --git a/go/integTest/shared_commands_test.go b/go/integTest/shared_commands_test.go index 3ae5059ee9..9abe3714cb 100644 --- a/go/integTest/shared_commands_test.go +++ b/go/integTest/shared_commands_test.go @@ -4140,9 +4140,9 @@ func (suite *GlideTestSuite) TestZincrBy() { func (suite *GlideTestSuite) TestBZPopMin() { suite.runWithDefaultClients(func(client api.BaseClient) { - key1 := "{listKey}-1-" + uuid.NewString() - key2 := "{listKey}-2-" + uuid.NewString() - key3 := "{listKey}-2-" + uuid.NewString() + key1 := "{zset}-1-" + uuid.NewString() + key2 := "{zset}-2-" + uuid.NewString() + key3 := "{zset}-2-" + uuid.NewString() // Add elements to key1 zaddResult1, err := client.ZAdd(key1, map[string]float64{"a": 1.0, "b": 1.5})