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 {
331331Setting expectations
332332*/
333333
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.
335338func (m * Mock ) Test (t TestingT ) {
336339m .mutex .Lock ()
337340defer m .mutex .Unlock ()
Original file line number Diff line number Diff line change 2323//
2424// The `require` package have same global functions as in the `assert` package,
2525// 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.
2628//
2729// Every assertion function also takes an optional string message as the final argument,
2830// 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