@@ -258,7 +258,7 @@ func (client *baseClient) MGet(keys []string) ([]Result[string], error) {
258258 return nil , err
259259 }
260260
261- return handleStringArrayResponse (result )
261+ return handleStringOrNilArrayResponse (result )
262262}
263263
264264func (client * baseClient ) Incr (key string ) (int64 , error ) {
@@ -391,7 +391,7 @@ func (client *baseClient) HMGet(key string, fields []string) ([]Result[string],
391391 return nil , err
392392 }
393393
394- return handleStringArrayResponse (result )
394+ return handleStringOrNilArrayResponse (result )
395395}
396396
397397func (client * baseClient ) HSet (key string , values map [string ]string ) (int64 , error ) {
@@ -430,7 +430,7 @@ func (client *baseClient) HLen(key string) (int64, error) {
430430 return handleIntResponse (result )
431431}
432432
433- func (client * baseClient ) HVals (key string ) ([]Result [ string ] , error ) {
433+ func (client * baseClient ) HVals (key string ) ([]string , error ) {
434434 result , err := client .executeCommand (C .HVals , []string {key })
435435 if err != nil {
436436 return nil , err
@@ -448,7 +448,7 @@ func (client *baseClient) HExists(key string, field string) (bool, error) {
448448 return handleBoolResponse (result )
449449}
450450
451- func (client * baseClient ) HKeys (key string ) ([]Result [ string ] , error ) {
451+ func (client * baseClient ) HKeys (key string ) ([]string , error ) {
452452 result , err := client .executeCommand (C .HKeys , []string {key })
453453 if err != nil {
454454 return nil , err
@@ -527,13 +527,13 @@ func (client *baseClient) LPop(key string) (Result[string], error) {
527527 return handleStringOrNilResponse (result )
528528}
529529
530- func (client * baseClient ) LPopCount (key string , count int64 ) ([]Result [ string ] , error ) {
530+ func (client * baseClient ) LPopCount (key string , count int64 ) ([]string , error ) {
531531 result , err := client .executeCommand (C .LPop , []string {key , utils .IntToString (count )})
532532 if err != nil {
533533 return nil , err
534534 }
535535
536- return handleStringArrayOrNullResponse (result )
536+ return handleStringArrayOrNilResponse (result )
537537}
538538
539539func (client * baseClient ) LPos (key string , element string ) (Result [int64 ], error ) {
@@ -554,7 +554,7 @@ func (client *baseClient) LPosWithOptions(key string, element string, options *L
554554 return handleIntOrNilResponse (result )
555555}
556556
557- func (client * baseClient ) LPosCount (key string , element string , count int64 ) ([]Result [ int64 ] , error ) {
557+ func (client * baseClient ) LPosCount (key string , element string , count int64 ) ([]int64 , error ) {
558558 result , err := client .executeCommand (C .LPos , []string {key , element , CountKeyword , utils .IntToString (count )})
559559 if err != nil {
560560 return nil , err
@@ -568,7 +568,7 @@ func (client *baseClient) LPosCountWithOptions(
568568 element string ,
569569 count int64 ,
570570 options * LPosOptions ,
571- ) ([]Result [ int64 ] , error ) {
571+ ) ([]int64 , error ) {
572572 result , err := client .executeCommand (
573573 C .LPos ,
574574 append ([]string {key , element , CountKeyword , utils .IntToString (count )}, options .toArgs ()... ),
@@ -768,7 +768,7 @@ func (client *baseClient) SMove(source string, destination string, member string
768768 return handleBoolResponse (result )
769769}
770770
771- func (client * baseClient ) LRange (key string , start int64 , end int64 ) ([]Result [ string ] , error ) {
771+ func (client * baseClient ) LRange (key string , start int64 , end int64 ) ([]string , error ) {
772772 result , err := client .executeCommand (C .LRange , []string {key , utils .IntToString (start ), utils .IntToString (end )})
773773 if err != nil {
774774 return nil , err
@@ -822,13 +822,13 @@ func (client *baseClient) RPop(key string) (Result[string], error) {
822822 return handleStringOrNilResponse (result )
823823}
824824
825- func (client * baseClient ) RPopCount (key string , count int64 ) ([]Result [ string ] , error ) {
825+ func (client * baseClient ) RPopCount (key string , count int64 ) ([]string , error ) {
826826 result , err := client .executeCommand (C .RPop , []string {key , utils .IntToString (count )})
827827 if err != nil {
828828 return nil , err
829829 }
830830
831- return handleStringArrayOrNullResponse (result )
831+ return handleStringArrayOrNilResponse (result )
832832}
833833
834834func (client * baseClient ) LInsert (
@@ -853,22 +853,22 @@ func (client *baseClient) LInsert(
853853 return handleIntResponse (result )
854854}
855855
856- func (client * baseClient ) BLPop (keys []string , timeoutSecs float64 ) ([]Result [ string ] , error ) {
856+ func (client * baseClient ) BLPop (keys []string , timeoutSecs float64 ) ([]string , error ) {
857857 result , err := client .executeCommand (C .BLPop , append (keys , utils .FloatToString (timeoutSecs )))
858858 if err != nil {
859859 return nil , err
860860 }
861861
862- return handleStringArrayOrNullResponse (result )
862+ return handleStringArrayOrNilResponse (result )
863863}
864864
865- func (client * baseClient ) BRPop (keys []string , timeoutSecs float64 ) ([]Result [ string ] , error ) {
865+ func (client * baseClient ) BRPop (keys []string , timeoutSecs float64 ) ([]string , error ) {
866866 result , err := client .executeCommand (C .BRPop , append (keys , utils .FloatToString (timeoutSecs )))
867867 if err != nil {
868868 return nil , err
869869 }
870870
871- return handleStringArrayOrNullResponse (result )
871+ return handleStringArrayOrNilResponse (result )
872872}
873873
874874func (client * baseClient ) RPushX (key string , elements []string ) (int64 , error ) {
@@ -1258,12 +1258,12 @@ func (client *baseClient) Unlink(keys []string) (int64, error) {
12581258 return handleIntResponse (result )
12591259}
12601260
1261- func (client * baseClient ) Type (key string ) (Result [ string ] , error ) {
1261+ func (client * baseClient ) Type (key string ) (string , error ) {
12621262 result , err := client .executeCommand (C .Type , []string {key })
12631263 if err != nil {
1264- return CreateNilStringResult () , err
1264+ return defaultStringResponse , err
12651265 }
1266- return handleStringOrNilResponse (result )
1266+ return handleStringResponse (result )
12671267}
12681268
12691269func (client * baseClient ) Touch (keys []string ) (int64 , error ) {
@@ -1275,12 +1275,12 @@ func (client *baseClient) Touch(keys []string) (int64, error) {
12751275 return handleIntResponse (result )
12761276}
12771277
1278- func (client * baseClient ) Rename (key string , newKey string ) (Result [ string ] , error ) {
1278+ func (client * baseClient ) Rename (key string , newKey string ) (string , error ) {
12791279 result , err := client .executeCommand (C .Rename , []string {key , newKey })
12801280 if err != nil {
1281- return CreateNilStringResult () , err
1281+ return defaultStringResponse , err
12821282 }
1283- return handleStringOrNilResponse (result )
1283+ return handleStringResponse (result )
12841284}
12851285
12861286func (client * baseClient ) Renamenx (key string , newKey string ) (bool , error ) {
@@ -1575,20 +1575,19 @@ func (client *baseClient) BZPopMin(keys []string, timeoutSecs float64) (Result[K
15751575//
15761576// Example:
15771577//
1578- // // Retrieve all members of a sorted set in ascending order
1579- // result, err := client.ZRange("my_sorted_set", options.NewRangeByIndexQuery(0, -1))
1580- //
1581- // // Retrieve members within a score range in descending order
1578+ // // Retrieve all members of a sorted set in ascending order
1579+ // result, err := client.ZRange("my_sorted_set", options.NewRangeByIndexQuery(0, -1))
15821580//
1583- // query := options.NewRangeByScoreQuery(options.NewScoreBoundary(3, false),
1584- // options.NewInfiniteScoreBoundary(options.NegativeInfinity)).
1585- //
1586- // .SetReverse()
1587- // result, err := client.ZRange("my_sorted_set", query)
1588- // // `result` contains members which have scores within the range of negative infinity to 3, in descending order
1581+ // // Retrieve members within a score range in descending order
1582+ // query := options.NewRangeByScoreQuery(
1583+ // options.NewScoreBoundary(3, false),
1584+ // options.NewInfiniteScoreBoundary(options.NegativeInfinity)).
1585+ // SetReverse()
1586+ // result, err := client.ZRange("my_sorted_set", query)
1587+ // // `result` contains members which have scores within the range of negative infinity to 3, in descending order
15891588//
15901589// [valkey.io]: https://valkey.io/commands/zrange/
1591- func (client * baseClient ) ZRange (key string , rangeQuery options.ZRangeQuery ) ([]Result [ string ] , error ) {
1590+ func (client * baseClient ) ZRange (key string , rangeQuery options.ZRangeQuery ) ([]string , error ) {
15921591 args := make ([]string , 0 , 10 )
15931592 args = append (args , key )
15941593 args = append (args , rangeQuery .ToArgs ()... )
@@ -1619,17 +1618,16 @@ func (client *baseClient) ZRange(key string, rangeQuery options.ZRangeQuery) ([]
16191618//
16201619// Example:
16211620//
1622- // // Retrieve all members of a sorted set in ascending order
1623- // result, err := client.ZRangeWithScores("my_sorted_set", options.NewRangeByIndexQuery(0, -1))
1624- //
1625- // // Retrieve members within a score range in descending order
1626- //
1627- // query := options.NewRangeByScoreQuery(options.NewScoreBoundary(3, false),
1628- // options.NewInfiniteScoreBoundary(options.NegativeInfinity)).
1621+ // // Retrieve all members of a sorted set in ascending order
1622+ // result, err := client.ZRangeWithScores("my_sorted_set", options.NewRangeByIndexQuery(0, -1))
16291623//
1630- // SetReverse()
1631- // result, err := client.ZRangeWithScores("my_sorted_set", query)
1632- // // `result` contains members with scores within the range of negative infinity to 3, in descending order
1624+ // // Retrieve members within a score range in descending order
1625+ // query := options.NewRangeByScoreQuery(
1626+ // options.NewScoreBoundary(3, false),
1627+ // options.NewInfiniteScoreBoundary(options.NegativeInfinity)).
1628+ // SetReverse()
1629+ // result, err := client.ZRangeWithScores("my_sorted_set", query)
1630+ // // `result` contains members with scores within the range of negative infinity to 3, in descending order
16331631//
16341632// [valkey.io]: https://valkey.io/commands/zrange/
16351633func (client * baseClient ) ZRangeWithScores (
0 commit comments