Merge pull request #1153 from jcox250/master

Add NewXMessagesSliceCmdResult & NewXStreamSliceCmdResult for testing
This commit is contained in:
Vladimir Mihailenco 2019-09-09 12:05:25 +03:00 committed by GitHub
commit 2a480cc543
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -146,3 +146,19 @@ 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
}
// 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
}