File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -331,7 +331,10 @@ func (m *Mock) TestData() objx.Map {
331
331
Setting expectations
332
332
*/
333
333
334
- // Test sets the test struct variable of the mock object
334
+ // Test sets the [TestingT] on which errors will be reported, otherwise errors
335
+ // will cause a panic.
336
+ // Test should not be called on an object that is going to be used in a
337
+ // goroutine other than the one running the test function.
335
338
func (m * Mock ) Test (t TestingT ) {
336
339
m .mutex .Lock ()
337
340
defer m .mutex .Unlock ()
Original file line number Diff line number Diff line change 23
23
//
24
24
// The `require` package have same global functions as in the `assert` package,
25
25
// but instead of returning a boolean result they call `t.FailNow()`.
26
+ // A consequence of this is that it must be called from the goroutine running
27
+ // the test function, not from other goroutines created during the test.
26
28
//
27
29
// Every assertion function also takes an optional string message as the final argument,
28
30
// allowing custom error messages to be appended to the message the assertion method outputs.
You can’t perform that action at this time.
0 commit comments