DO NOT submit tickets without first using the latest version of Go, clearing your local golang package cache, and re-building mockery using the latest Go version and the latest version of mockery. Please provide evidence this has been done in your issue. Failure to provide this evidence will likely result in your issue being closed.
Description
Following discussions on #782, it would be better to have RunAndReturn run correctly on functions not returning a value or entirely removed. Opening this issue for tracking the fix
Mockery Version
v2.46.2
Go Version
1.23
NOTE: Please upgrade to the latest golang version before submitting tickets!
Installation Method
[ ] Binary Distribution
[ ] Docker
[ ] brew
[x] go install
[ ] Other: [specify]
Steps to Reproduce
myMock.EXPECT().MyFuncWithReturn().RunAndReturn(func() {
// this is not called
})
Expected Behavior
Using RunAndReturn on a mocked function which does not return any value should either:
call the function
or not be possible at all (function not generated)
PLEASE READ
DO NOT submit tickets without first using the latest version of Go, clearing your local golang package cache, and re-building mockery using the latest Go version and the latest version of mockery. Please provide evidence this has been done in your issue. Failure to provide this evidence will likely result in your issue being closed.
Description
Following discussions on #782, it would be better to have RunAndReturn run correctly on functions not returning a value or entirely removed. Opening this issue for tracking the fix
Mockery Version
v2.46.2
Go Version
1.23
Installation Method
Steps to Reproduce
Expected Behavior
Using
RunAndReturn
on a mocked function which does not return any value should either:Actual Behavior
The call to the inner function is skipped