pashagolub / pgxmock

pgx mock driver for golang to test database interactions
Other
393 stars 49 forks source link

prevent double call rollback #41

Closed 2tvenom closed 3 years ago

2tvenom commented 3 years ago

its seems after return fErr function's return arg err receive value from fErr and defer always make Rollback.

Drop Rollback before statement

pashagolub commented 3 years ago

Hello.

Thanks for your efforts. The implementation is the same as in https://github.com/jackc/pgx/blob/0d20d1241e0232b6c6325711f90f005b7a11fd9d/tx.go#L108

We cannot change our own behavior as it would be different from the pgx one. pgxmock is a mocking library.

It should behave the same as the original pgx library.

You may want to submit the same PR to the https://github.com/jackc/pgx project. Then I will follow the changes and import them here.

Thanks a lot for your help!