You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I try to mock an interface with some returned values named (and others left as _), mockery generates invalid code, as it copies the _ names verbatim when generating the return function.
This is because it tries to use the _ as a value, which is a compile-time error: cannot use _ as value or type
The text was updated successfully, but these errors were encountered:
viswajithiii
changed the title
Cannot use mocks when only some return parameters are named
Generated code is invalid when only some return parameters are named
Jan 25, 2023
Description
If I try to mock an interface with some returned values named (and others left as
_
), mockery generates invalid code, as it copies the_
names verbatim when generating thereturn
function.Mockery Version
2.16.0
Golang Version
1.19.1
Installation Method
Steps to Reproduce
go generate
Expected Behavior
Valid generated code, like:
Actual Behavior
You will see that the generated code is invalid, like:
This is because it tries to use the
_
as a value, which is a compile-time error:cannot use _ as value or type
The text was updated successfully, but these errors were encountered: