From 74177b12f86695bdb98c4200da7ad681828778db Mon Sep 17 00:00:00 2001 From: James Cox <16992818+jcox250@users.noreply.github.com> Date: Fri, 6 Sep 2019 11:43:18 +0100 Subject: [PATCH] add NewXMessageSliceCmdResult to initialise XMessageSliceCmd for testing --- result.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/result.go b/result.go index 4356b28..b2733f1 100644 --- a/result.go +++ b/result.go @@ -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 +}