Closed massanchik closed 4 years ago
Hi @massanchik
Thanks for posting the bug! Please check out the latest v3.0.2 release and see if it works for you.
I'm using v3.0.6 and this bug is still active.
Trying to generate mock for method with return arguments (chan MyType, error)
will result in a generated method returning (MyType, error)
Hi,
As @sieuwerts mentioned it wasn't fixed. Some of my colleges also faced this issue and I hope I got the solution here https://github.com/hexdigest/gowrap/pull/25
Hi! I have interface like this
And when generated mock file with
minimock -i .Consumer
Inside it have
funcGetDone func() (ch1 error)
func (mmGetDone *mConsumerMockGetDone) Return(ch1 error) *ConsumerMock
func (mmGetDone *mConsumerMockGetDone) Set(f func() (ch1 error)) *ConsumerMock
func (mmGetDone *ConsumerMock) GetDone() (ch1 error)
Which breaks interface requirements
As a temporary workaround, you can break method into two like this:
Then it can generate right signatures
funcGetDoneRead func() (ch1 <-chan error)
funcGetDoneWrite func() (ch1 chan<- error)