File tree 2 files changed +4
-0
lines changed
2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -332,6 +332,8 @@ func (m *Mock) TestData() objx.Map {
332
332
*/
333
333
334
334
// Test sets the test struct variable of the mock object
335
+ // Test should not be called on an object that is going to be used in a
336
+ // goroutine other than the one running the test function.
335
337
func (m * Mock ) Test (t TestingT ) {
336
338
m .mutex .Lock ()
337
339
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