@@ -238,7 +238,7 @@ type Cmdable interface {
238
238
BitOpNot (ctx context.Context , destKey string , key string ) * IntCmd
239
239
BitPos (ctx context.Context , key string , bit int64 , pos ... int64 ) * IntCmd
240
240
BitPosSpan (ctx context.Context , key string , bit int8 , start , end int64 , span string ) * IntCmd
241
- BitField (ctx context.Context , key string , args ... interface {}) * IntSliceCmd
241
+ BitField (ctx context.Context , key string , values ... interface {}) * IntSliceCmd
242
242
243
243
Scan (ctx context.Context , cursor uint64 , match string , count int64 ) * ScanCmd
244
244
ScanType (ctx context.Context , cursor uint64 , match string , count int64 , keyType string ) * ScanCmd
@@ -1369,12 +1369,16 @@ func (c cmdable) BitPosSpan(ctx context.Context, key string, bit int8, start, en
1369
1369
return cmd
1370
1370
}
1371
1371
1372
- func (c cmdable ) BitField (ctx context.Context , key string , args ... interface {}) * IntSliceCmd {
1373
- a := make ([]interface {}, 0 , 2 + len (args ))
1374
- a = append (a , "bitfield" )
1375
- a = append (a , key )
1376
- a = append (a , args ... )
1377
- cmd := NewIntSliceCmd (ctx , a ... )
1372
+ // BitField accepts multiple values:
1373
+ // - BitField("set", "i1", "offset1", "value1","cmd2", "type2", "offset2", "value2")
1374
+ // - BitField([]string{"cmd1", "type1", "offset1", "value1","cmd2", "type2", "offset2", "value2"})
1375
+ // - BitField([]interface{}{"cmd1", "type1", "offset1", "value1","cmd2", "type2", "offset2", "value2"})
1376
+ func (c cmdable ) BitField (ctx context.Context , key string , values ... interface {}) * IntSliceCmd {
1377
+ args := make ([]interface {}, 2 , 2 + len (values ))
1378
+ args [0 ] = "bitfield"
1379
+ args [1 ] = key
1380
+ args = appendArgs (args , values )
1381
+ cmd := NewIntSliceCmd (ctx , args ... )
1378
1382
_ = c (ctx , cmd )
1379
1383
return cmd
1380
1384
}
0 commit comments