golang / mock

GoMock is a mocking framework for the Go programming language.
Apache License 2.0
9.3k stars 611 forks source link

doesn't match the argument at index 0 - context.background.withcancel.withcancel #614

Open jslota-rt opened 2 years ago

jslota-rt commented 2 years ago

Hello I am seeing an issue when trying to mock a method and not sure how to solve. Its a very simple error, but sort of says I'm getting the same thing, was hoping here would be a good place to ask

doesn't match the argument at index 0.
        Got: context.Background.WithCancel.WithCancel (*context.cancelCtx)
        Want: is equal to context.Background.WithCancel.WithCancel (*context.cancelCtx)
phamh79 commented 2 years ago

comparing two non-nil functions always returns false. Ref: https://github.com/golang/go/blob/86b5f6a7be707b9d84108df6f459c7e84bf9dbac/src/reflect/deepequal.go#L186