diff --git a/mock/mock.go b/mock/mock.go index 6e5f6f2db..d6694ed78 100644 --- a/mock/mock.go +++ b/mock/mock.go @@ -176,6 +176,7 @@ func (c *Call) Maybe() *Call { // Mock. // On("MyMethod", 1).Return(nil). // On("MyOtherMethod", 'a', 'b', 'c').Return(errors.New("Some Error")) +//go:noinline func (c *Call) On(methodName string, arguments ...interface{}) *Call { return c.Parent.On(methodName, arguments...) } diff --git a/mock/mock_test.go b/mock/mock_test.go index 978eae264..2608f5a36 100644 --- a/mock/mock_test.go +++ b/mock/mock_test.go @@ -32,6 +32,7 @@ func (i *TestExampleImplementation) TheExampleMethod(a, b, c int) (int, error) { return args.Int(0), errors.New("Whoops") } +//go:noinline func (i *TestExampleImplementation) TheExampleMethod2(yesorno bool) { i.Called(yesorno) } @@ -1492,6 +1493,7 @@ func unexpectedCallRegex(method, calledArg, expectedArg, diff string) string { rMethod, calledArg, rMethod, expectedArg, diff) } +//go:noinline func ConcurrencyTestMethod(m *Mock) { m.Called() }