mirror of
https://github.com/redis/go-redis.git
synced 2025-07-23 21:01:00 +03:00
add NewTimeCmdResult to allow unit testing with TimeCmd (#1298)
* add NewTimeCmdResult to allow unit testing with TimeCmd Co-authored-by: Conall OCallaghan <cocallaghan@nvidia.com>
This commit is contained in:
@ -98,6 +98,14 @@ func NewStringIntMapCmdResult(val map[string]int64, err error) *StringIntMapCmd
|
||||
return &cmd
|
||||
}
|
||||
|
||||
// NewTimeCmdResult returns a TimeCmd initialised with val and err for testing
|
||||
func NewTimeCmdResult(val time.Time, err error) *TimeCmd {
|
||||
var cmd TimeCmd
|
||||
cmd.val = val
|
||||
cmd.SetErr(err)
|
||||
return &cmd
|
||||
}
|
||||
|
||||
// NewZSliceCmdResult returns a ZSliceCmd initialised with val and err for testing
|
||||
func NewZSliceCmdResult(val []Z, err error) *ZSliceCmd {
|
||||
var cmd ZSliceCmd
|
||||
|
Reference in New Issue
Block a user