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
1 changed files with 8 additions and 0 deletions

View File

@ -146,3 +146,11 @@ func NewCommandsInfoCmdResult(val map[string]*CommandInfo, err error) *CommandsI
cmd.setErr(err) cmd.setErr(err)
return &cmd 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
}