Skip to content

Commit 5e9d366

Browse files
authored
Merge pull request #1184 from wingyplus/geo-pos-cmd-result
add NewGeoPosCmdResult to make GeoPos mockable result
2 parents 2713a25 + 6263992 commit 5e9d366

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

result.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ func NewGeoLocationCmdResult(val []GeoLocation, err error) *GeoLocationCmd {
139139
return &cmd
140140
}
141141

142+
// NewGeoPosCmdResult returns a GeoPosCmd initialised with val and err for testing
143+
func NewGeoPosCmdResult(val []*GeoPos, err error) *GeoPosCmd {
144+
var cmd GeoPosCmd
145+
cmd.val = val
146+
cmd.setErr(err)
147+
return &cmd
148+
}
149+
142150
// NewCommandsInfoCmdResult returns a CommandsInfoCmd initialised with val and err for testing
143151
func NewCommandsInfoCmdResult(val map[string]*CommandInfo, err error) *CommandsInfoCmd {
144152
var cmd CommandsInfoCmd

0 commit comments

Comments
 (0)