mirror of https://github.com/go-redis/redis.git
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:
parent
fc177c3607
commit
c9f2e839d2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue