1
0
mirror of https://github.com/redis/go-redis.git synced 2025-04-16 09:23:06 +03:00

add NewXMessageSliceCmdResult to initialise XMessageSliceCmd for testing

This commit is contained in:
James Cox 2019-09-06 11:43:18 +01:00
parent 3e1f1aba0e
commit 74177b12f8

View File

@ -146,3 +146,11 @@ func NewCommandsInfoCmdResult(val map[string]*CommandInfo, err error) *CommandsI
cmd.setErr(err)
return &cmd
}
// NewXMessageSliceCmdResult returns a XMessageSliceCmd initialised with val and err for testing
func NewXMessageSliceCmdResult(val []XMessage, err error) *XMessageSliceCmd {
var cmd XMessageSliceCmd
cmd.val = val
cmd.setErr(err)
return &cmd
}