diff --git a/gomock/call.go b/gomock/call.go index 1b748da..f1dd317 100644 --- a/gomock/call.go +++ b/gomock/call.go @@ -203,7 +203,7 @@ func (c *Call) dropPrereqs() (preReqs []*Call) { return } -func (c *Call) call(args []interface{}) (rets []interface{}, action func()) { +func (c *Call) call(args []interface{}) (action func() []interface {}) { c.numCalls++ // Actions @@ -218,22 +218,31 @@ func (c *Call) call(args []interface{}) (rets []interface{}, action func()) { doArgs[i] = reflect.Zero(ft.In(i)) } } - action = func() { c.doFunc.Call(doArgs) } + action = func() []interface {} { + result := c.doFunc.Call(doArgs) + rets := make([]interface{}, len(result)) + for i:=0; i