@@ -78,6 +78,7 @@ func (c *Call) Do(f interface{}) *Call {
78
78
return c
79
79
}
80
80
81
+ // Return declares the values to be returned by the mocked function call.
81
82
func (c * Call ) Return (rets ... interface {}) * Call {
82
83
mt := c .methodType
83
84
if len (rets ) != mt .NumOut () {
@@ -112,6 +113,7 @@ func (c *Call) Return(rets ...interface{}) *Call {
112
113
return c
113
114
}
114
115
116
+ // Times declares the exact number of times a function call is expected to be executed.
115
117
func (c * Call ) Times (n int ) * Call {
116
118
c .minCalls , c .maxCalls = n , n
117
119
return c
@@ -146,7 +148,7 @@ func (c *Call) SetArg(n int, value interface{}) *Call {
146
148
case reflect .Slice :
147
149
// nothing to do
148
150
default :
149
- c .t .Fatalf ("SetArg(%d, ...) referring to argument of non-pointer non-interface non-slice type %v" ,
151
+ c .t .Fatalf ("SetArg(%d, ...) referring to argument of non-pointer non-interface non-slice type %v [%s] " ,
150
152
n , at , c .origin )
151
153
}
152
154
c .setArgs [n ] = reflect .ValueOf (value )
@@ -204,7 +206,7 @@ func (c *Call) matches(args []interface{}) error {
204
206
}
205
207
for i , m := range c .args {
206
208
if ! m .Matches (args [i ]) {
207
- return fmt .Errorf ("Expected call at %s doesn't match the argument at index %s.\n Got: %v\n Want: %v\n " ,
209
+ return fmt .Errorf ("Expected call at %s doesn't match the argument at index %s.\n Got: %v\n Want: %v" ,
208
210
c .origin , strconv .Itoa (i ), args [i ], m )
209
211
}
210
212
}
0 commit comments