0

I am trying to do unit testing with sqlmock. I have the mock.ExpectBegin() and the mock.ExpectCommit(), but I keep getting this error:

there is a remaining expectation which was not matched: ExpectedBegin => expecting database transaction Begin

I'm not sure what to do to fix this. Any idea?

I've tried moving the begin command to different parts in the code and I've tried different ending mocks (i.e. expectRollback or expectClose) to no avail.

I'm just expecting the unit test to pass

0 Answers0