add NewXStreamSliceCmdResult to initialise XStreamSliceCmd for testing

This commit is contained in:
James Cox 2019-09-06 11:45:52 +01:00
parent 74177b12f8
commit fb31d51fc3
1 changed files with 8 additions and 0 deletions

View File

@ -154,3 +154,11 @@ func NewXMessageSliceCmdResult(val []XMessage, err error) *XMessageSliceCmd {
cmd.setErr(err) cmd.setErr(err)
return &cmd return &cmd
} }
// NewXStreamSliceCmdResult returns a XStreamSliceCmd initialised with val and err for testing
func NewXStreamSliceCmdResult(val []XStream, err error) *XStreamSliceCmd {
var cmd XStreamSliceCmd
cmd.val = val
cmd.setErr(err)
return &cmd
}